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. QT 5.5.1 ActiveX dynamicCall can not return correctly!
Forum Updated to NodeBB v4.3 + New Features

QT 5.5.1 ActiveX dynamicCall can not return correctly!

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.4k Views 2 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.
  • ct_2008C Offline
    ct_2008C Offline
    ct_2008
    wrote on last edited by
    #1

    look this codes:

    QAxObject* doc ;
    QAxObject* my_docs ;
    QAxObject* my_app = new QAxObject;

    my_app->setControl("Word.Application");

    my_docs =my_app->querySubObject("Documents");

    doc = my_docs->querySubObject("Open(const QVariant&, const QVariant&,const QVariant&, const QVariant&, const QVariant&, const QVariant&,const QVariant&)",
    filename);

    int ret = wordapp->dynamicCall("GetDocumentCount()").toInt(); //I thisk the correct return result is 1 ,but is 0;

    please tell me why is not return 1 or why it is wrony??

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      it return a Variant
      docs says
      "
      if the method does not return a value or when the function call failed this function returns an invalid QVariant object."

      so did you check with QVariant isValid() that the call does even have success ?

      ct_2008C 1 Reply Last reply
      2
      • mrjjM mrjj

        it return a Variant
        docs says
        "
        if the method does not return a value or when the function call failed this function returns an invalid QVariant object."

        so did you check with QVariant isValid() that the call does even have success ?

        ct_2008C Offline
        ct_2008C Offline
        ct_2008
        wrote on last edited by
        #3

        @mrjj
        thank you very much!
        the function name is not correctly which I passed, and the right function name is just like "DocumentCount",it is no Get before. <_>

        1 Reply Last reply
        1
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          and no () also I guess ?
          Good found :)

          ct_2008C 1 Reply Last reply
          1
          • mrjjM mrjj

            and no () also I guess ?
            Good found :)

            ct_2008C Offline
            ct_2008C Offline
            ct_2008
            wrote on last edited by
            #5

            @mrjj
            yes, your guess are right, propertys get or set interface are no ()!

            maybe this has some connection with the name of windows COM components propertys that called by QT dynamicCall("") .

            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