Hello friends,

when I call the code below I get this error:
QAxBase: Error calling IDispatch member SetSession: Type mismatch in parameter 0
QAxBase: Error calling IDispatch member SetObject: Type mismatch in parameter 0

I assume that I have to convert my types into a variant before give it to the dynamiccall method.

Qt Code:
  1. try
  2. {
  3. int ISessionPtrId = QMetaType::type("ISessionPtr");
  4. QVariant vSession(ISessionPtrId, &spSession);
  5. m_Control->dynamicCall("SetSession(ISessionPtr)", vSession);
  6. int IObjectPtrId = QMetaType::type("IObjectPtr");
  7. QVariant vObject(IWMObjectPtrId, &spObject);
  8. m_Control->dynamicCall("SetObject(IObjectPtr)", vObject);
  9. }
  10. catch(const std::exception &e)
  11. {
  12. qDebug() << e.what();
  13. }
  14. catch(...)
  15. {
  16. qDebug() << "m_Control->dynamicCall error";
  17. }
To copy to clipboard, switch view to plain text mode 

Could anybody help me to find out the right way?

Yours,