ActiveQt: dynamicCall() mit Rückgabeparametern
Verfasst: 14. Januar 2011 18:51
Hallo allerseits,
hat schon jemals jemand mit dynamicCall eine ActiveX-Methode aufgerufen, die Rückgabeparameter hat?
Laut Dokumentation müsste das doch funktionieren:
Bei mir wird vars nicht beschrieben.
Auszug aus meinem Code:
Funktioniert nicht. Der Wert von bCommsOK wird nicht aktualisiert.
Liegt nicht an der speziellen Methode (GetHWCommsOK), bei anderen funktionierts auch nicht. Ohne Rückgabeparameter funktioniert alles einwandfrei.
Zum Verzweifeln ...
hat schon jemals jemand mit dynamicCall eine ActiveX-Methode aufgerufen, die Rückgabeparameter hat?
Laut Dokumentation müsste das doch funktionieren:
Code: Alles auswählen
QVariant QAxBase::dynamicCall ( const char * function, QList<QVariant> & vars )
This is an overloaded function.
Calls the COM object's method function, passing the parameters in vars, and returns the value returned by the method. If the method does not return a value or when the function call failed this function returns an invalid QVariant object.
The QVariant objects in vars are updated when the method has out-parameters.Auszug aus meinem Code:
Code: Alles auswählen
bool bCommsOK = true;
QVariant var1;
var1.setValue(bCommsOK);
QList<QVariant> listVars;
listVars.clear();
listVars.append(var1);
motorPanel->dynamicCall("GetHWCommsOK(bool*)", listVars);
bCommsOK = listVars.at(0).toBool();Liegt nicht an der speziellen Methode (GetHWCommsOK), bei anderen funktionierts auch nicht. Ohne Rückgabeparameter funktioniert alles einwandfrei.
Zum Verzweifeln ...