Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Type mismatch using QAxBase::dynamiccall

Type mismatch using QAxBase::dynamiccall

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    robert_nickel
    wrote on last edited by
    #1

    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?

    Regards
    Robert

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved