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","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. -
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.)
-
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.)
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?