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.6k 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 MJ_P

    @mrjj
    Thanks!

    mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by mrjj
    #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
    • hskoglundH Online
      hskoglundH Online
      hskoglund
      wrote on 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 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
        • hskoglundH Online
          hskoglundH Online
          hskoglund
          wrote on 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
          0
          • hskoglundH hskoglund

            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 last edited by
            #14

            @hskoglund
            I am going to test it on friday.

            1 Reply Last reply
            0
            • hskoglundH hskoglund

              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 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
              • hskoglundH Online
                hskoglundH Online
                hskoglund
                wrote on 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
                1
                • hskoglundH hskoglund

                  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 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
                  • hskoglundH Online
                    hskoglundH Online
                    hskoglund
                    wrote on 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
                    1
                    • hskoglundH hskoglund

                      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 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.

                      hskoglundH 1 Reply Last reply
                      0
                      • M MJ_P

                        @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.

                        hskoglundH Online
                        hskoglundH Online
                        hskoglund
                        wrote on 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
                        1
                        • hskoglundH hskoglund

                          @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 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

                          • Login

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