PDA

View Full Version : How to use QAxWidget->dynamicCall() with VARIANT*



kim
21st September 2016, 01:08
need a help regarding following matter.

this is the function that I'm going to call using dynamicCall();->getContourLine(double x1, double y1, double x2, double y2, VARIANT* strPTs)

ui.axWidget->dynamicCall("getContourLine(double x1, double y1, double x2, double y2, VARIANT* strPTs)",202916,362432,200191,366623,"5th parameter here");

But I cant get value which return from VARIANT* strPTs since unable to define 5th parameter correctly . if anyone Can give a solution, more than appreciated!! Thank u very much!

ChrisW67
22nd September 2016, 22:06
According to http://doc.qt.io/qt-5/qaxbase.html you should be able to use a reference to a QVariant


QVariant strPTs;
ui.axWidget->dynamicCall(
"getContourLine(double x1, double y1, double x2, double y2, VARIANT*strPTs)",
202916, 362432, 200191, 366623, strPTs);

kim
11th October 2016, 11:01
Thank you @ChrisW67.

I tried it. But I get the same result which "CXX0030: Error: expression cannot be evaluated". When I do it with MFC I get the correct result as in the image.12158. Please help! thank you!