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. QAxBase: Error calling IDispatch member inAgentIP: Unknown error
Forum Updated to NodeBB v4.3 + New Features

QAxBase: Error calling IDispatch member inAgentIP: Unknown error

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.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.
  • K Offline
    K Offline
    Kycho
    wrote on last edited by Kycho
    #1

    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","127.0.0.1"); // Good Word!
        qDebug() << testWidget->property("inAgentIP"); // output : 127.0.0.1
    
    #define AGENT_ID "{74091A7F-FD8C-4440-96A2-CB2EB8BAD896}"
        QAxObject *testObj = new QAxObject(AGENT_ID);
        testObj->setProperty("inAgentIP","127.0.0.1"); // 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.

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      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.)

      K 1 Reply Last reply
      2
      • hskoglundH hskoglund

        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.)

        K Offline
        K Offline
        Kycho
        wrote on last edited by Kycho
        #3

        @hskoglund

        Thank you for your reply.

        AGENT_ID is the CLSID of ocx (ActiveX).

        https://doc.qt.io/qt-5/activeqt-container.html
        I saw the page above.
        In other words, does all ocx (ActiveX) mean to use QAxWidget?

        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #4

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

          1 Reply Last reply
          1

          • Login

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