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. QAxObject property returns invalid QVariant

QAxObject property returns invalid QVariant

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.4k Views 1 Watching
  • 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.
  • P Offline
    P Offline
    pelumu
    wrote on last edited by
    #1

    Hi,

    in my first Qt project I try to automate another application via OLE.

    Creating the application object and a sub object works (I see the form on desktop). Calling the method 'Quit' works too, but requesting a property value always returns an invalid QVariant.
    Any idea, what I do wrong?

    Here a part of my source code:
    @
    QAxObject broker;
    bool brokerReady = broker.setControl("Broker.Application");

    if(brokerReady)
    {
        QAxObject *analysis = broker.querySubObject("Analysis");
    
        QVariant version = broker.property("Version");
    
        broker.dynamicCall("Quit()");
    }
    

    @

    1 Reply Last reply
    0
    • C Offline
      C Offline
      chris17
      wrote on last edited by
      #2

      Did you try to get the version with dynamicCall?
      @
      QVariant version=broker.dynamicCall("Version");@

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pelumu
        wrote on last edited by
        #3

        No. So I didn't try it.

        But, it works!!!!!

        On this idea I would never have come. Requesting a property value with calling a method.

        Thank you very very very much for your help!!!!

        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