QT 5.5.1 ActiveX dynamicCall can not return correctly!
-
look this codes:
QAxObject* doc ;
QAxObject* my_docs ;
QAxObject* my_app = new QAxObject;my_app->setControl("Word.Application");
my_docs =my_app->querySubObject("Documents");
doc = my_docs->querySubObject("Open(const QVariant&, const QVariant&,const QVariant&, const QVariant&, const QVariant&, const QVariant&,const QVariant&)",
filename);int ret = wordapp->dynamicCall("GetDocumentCount()").toInt(); //I thisk the correct return result is 1 ,but is 0;
please tell me why is not return 1 or why it is wrony??
-
it return a Variant
docs says
"
if the method does not return a value or when the function call failed this function returns an invalid QVariant object."so did you check with QVariant isValid() that the call does even have success ?
-
it return a Variant
docs says
"
if the method does not return a value or when the function call failed this function returns an invalid QVariant object."so did you check with QVariant isValid() that the call does even have success ?
-
and no () also I guess ?
Good found :)