Unsolved ActiveQt dynamicCall error: Unknown error
-
@mrjj
Thanks! -
@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 ?) -
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 likenew QAxObject("CT.Application");
) has a visible property, try setting it to true. Note: this is just a guess :-) -
@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.
-
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.
-
@hskoglund
I am going to test it on friday. -
@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?
-
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);
-
@hskoglund
Hi, also the same error…
QAxBase: Error calling IDispatch member GetDrawingArea: Unknown errorqDebug on parameters after calling the function:
(QVariant(double, 0), QVariant(double, 0), QVariant(double, 0), QVariant(double, 0)) -
Hmm, seems like E³ indeed is not happy talking to Qt5 using QAxObject, there are some alternatives:
-
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.
-
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. -
-
@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. -
@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?
-
@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.