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. Undocumented feature : QAxBase and void/missing parameter(s) to COM Objects functions

Undocumented feature : QAxBase and void/missing parameter(s) to COM Objects functions

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 527 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.
  • D Offline
    D Offline
    deleted426
    wrote on last edited by deleted426
    #1

    Hi everybody,

    I spent a lot of hours yesterday, trying and reading everywhere that it was impossible to do so. But I had no possible workaround.
    I succeeded, doing something very simple at the end, but that is not written anywhere into the documentation or any old discussion of people who all gave up at the end.

    Sometimes you should call, on a given COM object, something like.

    QAxObject* subObject = (QAxObject*)ParentObject->querySubObject("Item(QVariant Name, QVariant Index)", Name, Index)

    But you should enter only Name or Index. In my case no Name was possible so I should ask for Index 0 without giving any name. (not even "null", "", any int or anything : nothing). Parameters taken by "querySubObject" are QVariant but no QVariant available Type nor value did the job of "non arguments"
    In fact the only possible existing variable in C++ that does the job is described here but not compatible with Qt QAxObjets : "vtMissing"
    https://msdn.microsoft.com/en-us/library/ms675103(v=vs.85).aspx (search for "missing")
    It's a VARIANT where the type is VT_ERROR and value is DISP_E_PARAMNOTFOUND
    Event VARIANTtoQVariant doesn't do the correct conversion (it gives a type QVariant::Invalid but it's not the same and it doesn't work)

    The solution is the following :
    You can enter parameters into the string given to querySubObject, for example :
    querySubObject("Item("item1234", 2)");
    Then if you want to give a non-parameter you should enter "void" as parameter

    querySubObject("Item(void, 0)");
    or
    querySubObject("Item(void, QVariant)", 0, 0); //The first 0 is ignored (first parameter is void), the second 0 is used as second parameter

    People who never found the solution :

    http://www.qtforum.org/article/29157/write-in-excel-file-problem.html
    http://www.qtcentre.org/archive/index.php/t-46748.html
    http://www.qtcentre.org/archive/index.php/t-46885.html

    I was about to give up when I finally found the solution by trying eveything.
    Is it possible to document it into QAxBase documentation about querySubObject and dynamicCall ?

    Thank you in advance !

    Julien

    1 Reply Last reply
    2
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Sure it's possible ! You can even do it yourself :)

      You can modify the module's documentation and submit your work for inclusion through gerrit.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • D Offline
        D Offline
        deleted426
        wrote on last edited by
        #3

        Thank you for your answer, OK then I'll try do it today ;)

        Bye

        1 Reply Last reply
        1

        • Login

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