ActiveX: How to call method/property in another interface
-
I'm working with an internal ActiveX control - written in c++. Using QAxWidget to host the activex control and using dynamicCall() to set properties and call methods, so far its working well.
However, some of the properties return Interfaces (IDispatch*) that I need to use to call a different set of properties and methods. What I can't figure out is how to invoke those? I did try dumpdoc and it does show those properties that return the interfaces but the code sample only shows that it returns IDispatch* - nothing about how to use it?
IDispatch* val = object->property("StorageSettings").toIDispatch*();
Assuming there is a method "Stop()" in Interface returned by "StorageSettings", how would I go about using it?
-
I'm working with an internal ActiveX control - written in c++. Using QAxWidget to host the activex control and using dynamicCall() to set properties and call methods, so far its working well.
However, some of the properties return Interfaces (IDispatch*) that I need to use to call a different set of properties and methods. What I can't figure out is how to invoke those? I did try dumpdoc and it does show those properties that return the interfaces but the code sample only shows that it returns IDispatch* - nothing about how to use it?
IDispatch* val = object->property("StorageSettings").toIDispatch*();
Assuming there is a method "Stop()" in Interface returned by "StorageSettings", how would I go about using it?
Figured it out myself :)
Use querySubOject() method. Use the returned AxObject as a COM interface to call any method/property on that interface.