PDA

View Full Version : what shoudl I do if I can not find an interface of Activex with qaxobject



DJW602
29th June 2016, 09:44
For example, Activex A has a function called "x",
now I try to use it through mapping Activex A to Qaxobject. And I can not find the interface"x" with "dynamicCall".

My question is whether I could do something to find the missing interface.

d_stranz
1st July 2016, 19:47
If you are calling "x" properly, through a COM object that implements and interface that contains a method or property "x", then it will be found. If your COM object implements the IOleObject interface, then QAxBase::verbs() will return a string list of the verbs that the object can execute through that interface. The QAxBase::propertyBag() returns a map that contains the names of all of the properties that can be read/written through the object. I do not know if there is a mechanism through QAxObject / QAxBase to get a list of all of the interfaces, methods, and properties exposed by an ActiveX object. However, you can always use QAxBase::queryInterface() to get a raw interface pointer and use COM methods directly to interrogate the object (in the same way the OLE/Com object viewer does.

The OLE/Com object viewer (https://msdn.microsoft.com/en-us/library/d0kh9f4c.aspx) will tell you what objects, interfaces, and methods are exposed by your COM DLL.

I suspect that your dynamicCall is failing because of one or more of the following:

- "x" doesn't exist in the interface(s) exposed by your QAxObject
- you are calling it incorrectly
- the parameters you are passing are incorrect