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. QAxObject->dynamicCall() throws Type Mismatch (Solved)
QtWS25 Last Chance

QAxObject->dynamicCall() throws Type Mismatch (Solved)

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 6.1k Views
  • 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.
  • C Offline
    C Offline
    clinisbut
    wrote on last edited by
    #1

    Here is my example code (very simple)

    @activex = new QAxObject("832C30D8-7062-44AC-878E-0C7C64B245A8");
    activex->setProperty("Settings", QString("9600,n,8,1") );@

    Throws this (Description in spanish):

    @QAxBase: Error calling IDispatch member Settings: Exception thrown by server
    Code : 13
    Source : Comm32
    Description: No coinciden los tipos (type mismatch)
    Help :
    Connect to the exception(int,QString,QString,QString) signal to catch this exception@

    Using QAxBase::generateDocumentation() clearly says that :

    @QString Settings

    For more information, see help context 23 in C:\WINDOWS\system32\Comm32.chm. 
    
    Read this property's value using QObject::property:
    

    QString val = object->property("Settings").toString();
    Set this property' value using QObject::setProperty:
    QString newValue = ...
    object->setProperty("Settings", newValue);
    Or using the SetSettings slot.@

    .. which is exactly what I'm trying to do.
    Calling dynamicCall( "SetSettings(QString)", QString("9600,n,8,1") ); doesn't help too...

    I must add that using another control like MSComm32 I have no problems (related with Qt, MSComm32 has other more serious problems)

    If it helps, debugging into code I found that the exception is thrown when Qt tries to call Invoke() method of the IDispath class, inside

    @QAxBase::internalProperty@

    At line 3553, file qaxbase.cpp.

    EDIT

    Ok I solved it.
    It happens that the COM control I was trying to use is visual, and I should use QAxWidget instead of QAxObject. So replacing QAxObject by QAxWidget in the code above makes everything work.

    Thank you anyway.

    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