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. ActiveX: How to call method/property in another interface
QtWS25 Last Chance

ActiveX: How to call method/property in another interface

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 213 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.
  • T Offline
    T Offline
    Taytoo
    wrote on last edited by
    #1

    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?

    T 1 Reply Last reply
    0
    • T Taytoo

      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?

      T Offline
      T Offline
      Taytoo
      wrote on last edited by
      #2

      Figured it out myself :)

      Use querySubOject() method. Use the returned AxObject as a COM interface to call any method/property on that interface.

      1 Reply Last reply
      0

      • Login

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