Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. ActiveQt dynamicCall error: Unknown error
Forum Updated to NodeBB v4.3 + New Features

ActiveQt dynamicCall error: Unknown error

Scheduled Pinned Locked Moved Unsolved General and Desktop
21 Posts 3 Posters 3.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mrjj
    Lifetime Qt Champion
    wrote on 12 Nov 2018, 15:35 last edited by mrjj 11 Dec 2018, 15:36
    #2

    Hi and welcome to the forums.
    Does Qt4.x code work on SAME pc ?
    I wonder if the actual ActiveX object might have changed ?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MJ_P
      wrote on 12 Nov 2018, 15:43 last edited by
      #3

      Hi, thanks.
      Yes, the previous compiled binary works.
      I have to add some new features and so I tried to upgrade to Qt5.x.
      I have got a similar function with less Parameters at the same code which works...

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 12 Nov 2018, 15:46 last edited by
        #4

        Hi
        Ok, so the ActiveX object should be the same.
        I wonder if related to
        https://bugreports.qt.io/browse/QTBUG-13845
        but it works for 4.8 so cant be.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MJ_P
          wrote on 12 Nov 2018, 15:53 last edited by
          #5

          The posted dynamicCall works currently at Qt4.7.4
          I think it is not the same bug...

          M 1 Reply Last reply 12 Nov 2018, 15:59
          1
          • M MJ_P
            12 Nov 2018, 15:53

            The posted dynamicCall works currently at Qt4.7.4
            I think it is not the same bug...

            M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 12 Nov 2018, 15:59 last edited by
            #6

            @MJ_P
            I agree.
            However, I could not find any other bug about this.
            It could be regression.
            Could you try with 5.9 ?

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MJ_P
              wrote on 12 Nov 2018, 16:36 last edited by
              #7

              @mrjj
              Just compiled with 5.9.6:
              Same behaviour…

              M 1 Reply Last reply 12 Nov 2018, 16:59
              1
              • M MJ_P
                12 Nov 2018, 16:36

                @mrjj
                Just compiled with 5.9.6:
                Same behaviour…

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 12 Nov 2018, 16:59 last edited by
                #8

                @MJ_P
                Ok, its either something changed using QVariant
                or simply a bug. (regression from 4.8 to 5.XX)
                Give it a day or two. if nobody else have more information
                i would open a bug report.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  MJ_P
                  wrote on 12 Nov 2018, 17:25 last edited by
                  #9

                  @mrjj
                  Thanks!

                  M 1 Reply Last reply 12 Nov 2018, 17:28
                  0
                  • M MJ_P
                    12 Nov 2018, 17:25

                    @mrjj
                    Thanks!

                    M Offline
                    M Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 12 Nov 2018, 17:28 last edited by mrjj 11 Dec 2018, 17:28
                    #10

                    @MJ_P
                    Oh, i realized the wording was funny.
                    -> Give it a day or two. if nobody else have more information
                    you should open a bug report.

                    If you can provide a minimal example to reproduce this,
                    it really helps. Also info about what ActiveX object you are using. ( libra office perhaps ?)

                    1 Reply Last reply
                    0
                    • H Online
                      H Online
                      hskoglund
                      wrote on 12 Nov 2018, 22:28 last edited by
                      #11

                      Hi, the ActiveX support in Qt is ancient and should be the same for Qt4 and Qt5, so you should be getting your 4 floats (xmin, ymin, xmax, ymax) in Qt5 also.
                      Googled and found this so if the app object (the one you create with something like new QAxObject("CT.Application");) has a visible property, try setting it to true. Note: this is just a guess :-)

                      1 Reply Last reply
                      1
                      • M Offline
                        M Offline
                        MJ_P
                        wrote on 13 Nov 2018, 08:26 last edited by
                        #12

                        @hskoglund
                        Hi, you are right. I am using here an app object of E³ ( new QAxObject("Ct.Sheet")).
                        I guess the problem is not the ActiveX itself. The Language of the App is german.
                        Since Qt5 every string conversion is done by the 'C' locale now.
                        At Qt4 the current locale was used for conversions. (toDouble() and so on)
                        Perhaps the floats of xmin, ymin, xmax and ymax are formated as
                        0,0, 0,0, 420,0 270,0 by E³ and so an internal conversion fails now.
                        It is just a guess, but it is the only huge diff I found…

                        Other dynamicCalls to E³ which return int or Strings work fine.

                        1 Reply Last reply
                        0
                        • H Online
                          H Online
                          hskoglund
                          wrote on 13 Nov 2018, 12:39 last edited by
                          #13

                          Hmm, you could try changing to US locale, for example by creating a new user on your PC, set that user's locale/language to US and try the call again for that user.

                          M 2 Replies Last reply 13 Nov 2018, 16:57
                          0
                          • H hskoglund
                            13 Nov 2018, 12:39

                            Hmm, you could try changing to US locale, for example by creating a new user on your PC, set that user's locale/language to US and try the call again for that user.

                            M Offline
                            M Offline
                            MJ_P
                            wrote on 13 Nov 2018, 16:57 last edited by
                            #14

                            @hskoglund
                            I am going to test it on friday.

                            1 Reply Last reply
                            0
                            • H hskoglund
                              13 Nov 2018, 12:39

                              Hmm, you could try changing to US locale, for example by creating a new user on your PC, set that user's locale/language to US and try the call again for that user.

                              M Offline
                              M Offline
                              MJ_P
                              wrote on 16 Nov 2018, 11:18 last edited by
                              #15

                              @hskoglund
                              Ok, I have tested on US-Windows and US Installation of E³.
                              The Bug still exists. It is not a language issue.

                              Any other idea what I can try?

                              1 Reply Last reply
                              0
                              • H Online
                                H Online
                                hskoglund
                                wrote on 16 Nov 2018, 16:44 last edited by
                                #16

                                Hi, just guessing but have you tried initializing the QVariants to 0.0, like this:

                                QList<QVariant> parameters;
                                parameters << QVariant(0.0);
                                parameters << QVariant(0.0);
                                parameters << QVariant(0.0);
                                parameters << QVariant(0.0);
                                dynamicCall("GetDrawingArea(QVariant&,QVariant&,QVariant&,QVariant&)",parameters);
                                
                                M 1 Reply Last reply 19 Nov 2018, 08:14
                                1
                                • H hskoglund
                                  16 Nov 2018, 16:44

                                  Hi, just guessing but have you tried initializing the QVariants to 0.0, like this:

                                  QList<QVariant> parameters;
                                  parameters << QVariant(0.0);
                                  parameters << QVariant(0.0);
                                  parameters << QVariant(0.0);
                                  parameters << QVariant(0.0);
                                  dynamicCall("GetDrawingArea(QVariant&,QVariant&,QVariant&,QVariant&)",parameters);
                                  
                                  M Offline
                                  M Offline
                                  MJ_P
                                  wrote on 19 Nov 2018, 08:14 last edited by
                                  #17

                                  @hskoglund
                                  Hi, also the same error…
                                  QAxBase: Error calling IDispatch member GetDrawingArea: Unknown error

                                  qDebug on parameters after calling the function:
                                  (QVariant(double, 0), QVariant(double, 0), QVariant(double, 0), QVariant(double, 0))

                                  1 Reply Last reply
                                  0
                                  • H Online
                                    H Online
                                    hskoglund
                                    wrote on 19 Nov 2018, 09:25 last edited by hskoglund
                                    #18

                                    Hmm, seems like E³ indeed is not happy talking to Qt5 using QAxObject, there are some alternatives:

                                    1. if there's a .tlb file (type library file) available for E³ then you can try using Qt's dumpcpp tool on it. Dumpcpp.exe will create C++ wrapper classes than can be included in your program instead of going through QAxObject.

                                    2. you can go native and use Microsoft's old ATL library to invoke E³'s COM methods directly, it's called classic COM (I spent most of the 90's and the years around the turn of the century doing exactly that :-))

                                    Edit: forgot to say, if you have lots of calls through QAxObject that do work, then alternative 1) might not be a good idea because you have to refactor all the calls.
                                    But with alternative 2) you can opt to use ATL/Classic COM just for that single GetDrawingArea() function, i.e. you can still use QAxObject and obtain a COM pointer through it for use in Classic COM.

                                    M 1 Reply Last reply 19 Nov 2018, 10:01
                                    1
                                    • H hskoglund
                                      19 Nov 2018, 09:25

                                      Hmm, seems like E³ indeed is not happy talking to Qt5 using QAxObject, there are some alternatives:

                                      1. if there's a .tlb file (type library file) available for E³ then you can try using Qt's dumpcpp tool on it. Dumpcpp.exe will create C++ wrapper classes than can be included in your program instead of going through QAxObject.

                                      2. you can go native and use Microsoft's old ATL library to invoke E³'s COM methods directly, it's called classic COM (I spent most of the 90's and the years around the turn of the century doing exactly that :-))

                                      Edit: forgot to say, if you have lots of calls through QAxObject that do work, then alternative 1) might not be a good idea because you have to refactor all the calls.
                                      But with alternative 2) you can opt to use ATL/Classic COM just for that single GetDrawingArea() function, i.e. you can still use QAxObject and obtain a COM pointer through it for use in Classic COM.

                                      M Offline
                                      M Offline
                                      MJ_P
                                      wrote on 19 Nov 2018, 10:01 last edited by
                                      #19

                                      @hskoglund
                                      Using e3.tlb doesn't work on GetDrawingArea function.
                                      It seems to be the same problem. The parameters are also invalid.
                                      The C++ wrapper works on Qt4 but not on Qt5.

                                      H 1 Reply Last reply 19 Nov 2018, 15:21
                                      0
                                      • M MJ_P
                                        19 Nov 2018, 10:01

                                        @hskoglund
                                        Using e3.tlb doesn't work on GetDrawingArea function.
                                        It seems to be the same problem. The parameters are also invalid.
                                        The C++ wrapper works on Qt4 but not on Qt5.

                                        H Online
                                        H Online
                                        hskoglund
                                        wrote on 19 Nov 2018, 15:21 last edited by
                                        #20

                                        @MJ_P
                                        I see, I'm guessing something in E³ 's implementation of COM is not 100% kosher, perhaps Qt4 was more generous in this regard.
                                        So alternative 2), a plunge into Classic Com seems to be only option then.
                                        It's not that bad :-)

                                        Maybe I can help, is there a demo version of something of E³ that I can download and test with?

                                        M 1 Reply Last reply 20 Nov 2018, 08:55
                                        1
                                        • H hskoglund
                                          19 Nov 2018, 15:21

                                          @MJ_P
                                          I see, I'm guessing something in E³ 's implementation of COM is not 100% kosher, perhaps Qt4 was more generous in this regard.
                                          So alternative 2), a plunge into Classic Com seems to be only option then.
                                          It's not that bad :-)

                                          Maybe I can help, is there a demo version of something of E³ that I can download and test with?

                                          M Offline
                                          M Offline
                                          MJ_P
                                          wrote on 20 Nov 2018, 08:55 last edited by
                                          #21

                                          @hskoglund
                                          I guess there is no demo version of E³ available.
                                          The only option is to contact Zuken (manufacturer) and
                                          ask for a limited testing license.
                                          The last demo version without license was E³-2009.

                                          1 Reply Last reply
                                          0

                                          11/21

                                          12 Nov 2018, 22:28

                                          • Login

                                          • Login or register to search.
                                          11 out of 21
                                          • First post
                                            11/21
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved