Hi,
I've got a problem with an ActiveX. I can successfully call functions except those with a VARIANT* parameter. I will take the GetMPStepMessages function as example.
When calling the documentation() function on the ActiveX, it returns this:
Call the function directly:
QVAriantList params = ...
bool result = object->dynamicCall("GetMPStepMessages(QVariant&)", params).toBool();
I try to call this function exactly like this, but it returns this error message:
"Error calling IDispatch member GetMPStepMessages: type mismatch in parameter 0"

Second try, i generate the class with the dumcpp tool from Qt. But same error: "type mismatch in parameter 0." I try with a QVariant, QVariantList, ... but same problem.

Debuging the dynamicCall() function, it shows that it is a wrapper around the IDispatch::Invoke method. https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
When the dynamicCall function is called with a QVariant containing a QVariantList as parameter, the invoke method (in qaxobject.cpp) is called with a VARIANT wich is of type VT_BOOL | VT_BYREF, wich obviously is wrong because there is no BOOL in my parameters.

Then, i successfully manage to call this function, but directly with the IDispatch::invoke method by myself. To works, the VARIANT parameters must have the type VT_VARIANT | VT_BYREF.

So my question is, why Qt failed to transform a QVariant to a VARIANT with type of VT_VARIANT | VT_BYREF. Is it a bug?

Maybe it should help, so here is the call in VC++:
Qt Code:
  1. BOOL GetMPStepMessages(VARIANT* vArray)
  2. {
  3. BOOL result;
  4. static BYTE parms[] = VTS_PVARIANT;
  5. InvokeHelper(0x14, DISPATCH_METHOD, VT_BOOL, (void*)&result, parms, vArray);
  6. return result;
  7. }
To copy to clipboard, switch view to plain text mode 
Thanks.