Important: Please read the Qt Code of Conduct -

QAxBase: Error calling IDispatch member inAgentIP: Unknown error

  • I do not understand why the error is happening.
    The QAxWidget class works fine,
    The QAxObject class does not work.

    #define AGENT_ID "{74091A7F-FD8C-4440-96A2-CB2EB8BAD896}"
        QAxWidget *testWidget = new QAxWidget(AGENT_ID);
        testWidget->setProperty("inAgentIP",""); // Good Word!
        qDebug() << testWidget->property("inAgentIP"); // output :
    #define AGENT_ID "{74091A7F-FD8C-4440-96A2-CB2EB8BAD896}"
        QAxObject *testObj = new QAxObject(AGENT_ID);
        testObj->setProperty("inAgentIP",""); // QAxBase: Error calling IDispatch member inAgentIP: Unknown error
        qDebug() << testObj->property("inAgentIP"); // output : null

    QAxWidget should use QAxObject because it is difficult to move threads.
    Thank you for your help.

  • Hi, just guessing, but if the COM object you're starting (AGENT_ID) requires a window (HWND), for example if it's an OCX or ActiveX control DLL, then that could explain why QAxWidget works as a container for it but QAxObject does not. (Because QAxObject does not create a window for the COM control.)

  • @hskoglund

    Thank you for your reply.

    AGENT_ID is the CLSID of ocx (ActiveX).
    I saw the page above.
    In other words, does all ocx (ActiveX) mean to use QAxWidget?

  • Hi, yes. If the ActiveX control has a user interface (a window) then QAxWidget is needed as a container for that window.

Log in to reply