Type mismatch using QAxBase::dynamiccall

  • Hi,

    I am using the ActiveQt API to access COM objects. This works great so far. However, I am experiencing problems when SAFEARRAY parameters are involved. Please consider the following function:

    @HRESULT GetExistingFacetTolerances (long * ToleranceCount, SAFEARRAY * * ExistingTolerances );@

    I have used QAxBase::generateDocumentation() with the following results concerning this function:
    @void GetExistingFacetTolerances (int& ToleranceCount, QVariantList*& ExistingTolerances) [slot]@
    Connect a signal to this slot:

    @QObject::connect(sender, SIGNAL(someSignal(int&, QVariantList*&)), object, SLOT(GetExistingFacetTolerances(int&, QVariantList*&)));@
    Or call the function directly:
    QVariantList params = ...
    object->dynamicCall("GetExistingFacetTolerances(int&, QVariantList*&)", params);

    Following the latter approach, my code reads as follows:
    int tolCount = 0;
    QVariantList * tolerances = new QVariantList();
    QVariantList params;
    params << tolCount << qVariantFromValue((void*)tolerances);
    object->dynamicCall("GetExistingFacetTolerances(int&, QVariantList*&)", params);

    The last line results in an error (output window): "QAxBase: Error calling IDispatch member GetExistingFacetTolerances: Type mismatch in parameter 1"

    I have tried many variants passing the second parameter (also including QVariantList&). What is the common way of passing a pointer as a parameter to dynamicCall? I have also tried using signals and slots but this yields exactly the same error message. Unfortunately I cannot debug into the QAxBase code to see what the problem is.

    Is SAFEARRAY ** an unsupported type and I have to use the IDispatch interface directly?

    Can anyone help?


Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.