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. How to generate the documentation for subobject of QAxObject?
Forum Update on Monday, May 27th 2025

How to generate the documentation for subobject of QAxObject?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 256 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.
  • W Offline
    W Offline
    Wang xiaohu
    wrote on 24 Feb 2021, 11:45 last edited by Wang xiaohu
    #1

    Hello,
    I'm using the QAxObject/QAxBase framework, but I got stuck in how to know the documentation for the suboject of QAxObject.

    This is my code:

    QAxObject *teObject = new QAxObject;
    teObject->setControl(QString::fromUtf8("{3A4F919D-65A8-11D5-85C1-0001023952C1}")); //SGWorld71
    QString terraString = teObject->generateDocumentation();  //This work, and I got the documentation for "SGWorld71 Class Reference".
    

    In file "SGWorld71 Class Reference", I got the description:
    “
    ....

    Properties:

    • .......

    • IAnalysis71* Analysis;

    • IDateTime71* DateTime;

    • INavigate71* Navigate;

    • IProject71* Project;

    • IProjectTree71* ProjectTree;

    • ......

    "
    And I want to know the reference for the subobject of SGWorld71, for example, IAnalysis71, INavigate71, IProject71, and so on; so I can khow the parameters of QAxBase::dynamicCall() function to call the suboject's method.

    And I use this code:

    QAxObject* anaObject = teObject->querySubObject("Analysis");
    terraString = anaObject->generateDocumentation();  // This doesn't work.
    

    I got this error:
    (error.png

    So what went wrong? And, Is there other way to know the method, properties and other reference of the subobject of one QAxObject?

    P 1 Reply Last reply 24 Feb 2021, 12:36
    0
    • W Wang xiaohu
      24 Feb 2021, 11:45

      Hello,
      I'm using the QAxObject/QAxBase framework, but I got stuck in how to know the documentation for the suboject of QAxObject.

      This is my code:

      QAxObject *teObject = new QAxObject;
      teObject->setControl(QString::fromUtf8("{3A4F919D-65A8-11D5-85C1-0001023952C1}")); //SGWorld71
      QString terraString = teObject->generateDocumentation();  //This work, and I got the documentation for "SGWorld71 Class Reference".
      

      In file "SGWorld71 Class Reference", I got the description:
      “
      ....

      Properties:

      • .......

      • IAnalysis71* Analysis;

      • IDateTime71* DateTime;

      • INavigate71* Navigate;

      • IProject71* Project;

      • IProjectTree71* ProjectTree;

      • ......

      "
      And I want to know the reference for the subobject of SGWorld71, for example, IAnalysis71, INavigate71, IProject71, and so on; so I can khow the parameters of QAxBase::dynamicCall() function to call the suboject's method.

      And I use this code:

      QAxObject* anaObject = teObject->querySubObject("Analysis");
      terraString = anaObject->generateDocumentation();  // This doesn't work.
      

      I got this error:
      (error.png

      So what went wrong? And, Is there other way to know the method, properties and other reference of the subobject of one QAxObject?

      P Offline
      P Offline
      Pl45m4
      wrote on 24 Feb 2021, 12:36 last edited by
      #2

      @Wang-xiaohu

      Does it work if you pick one function from here (https://www.skylinesoft.com/hubfs/KB_Resources/TED/Web Help/Programmers Guide/index.htm?#t=Analysis_IAnalysis71.htm) and just call it?

      Is your parent QAxObject still "alive" and valid when you try to access the sub-object?


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      W 2 Replies Last reply 24 Feb 2021, 15:07
      0
      • P Pl45m4
        24 Feb 2021, 12:36

        @Wang-xiaohu

        Does it work if you pick one function from here (https://www.skylinesoft.com/hubfs/KB_Resources/TED/Web Help/Programmers Guide/index.htm?#t=Analysis_IAnalysis71.htm) and just call it?

        Is your parent QAxObject still "alive" and valid when you try to access the sub-object?

        W Offline
        W Offline
        Wang xiaohu
        wrote on 24 Feb 2021, 15:07 last edited by
        #3

        @Pl45m4
        Thanks for your reply. The website you gave is very useful! As a beginner, I don't know whether the the full function prototype from the skylinesoft website (that is the COM component's function prototype) is same with that provided by QAxObject, which wraps the COM object.
        For example, one function in "SGWorld71 Class Reference" generated by Qt is:

        void SetOptionParam(QString paramName, QVariant paramVal);
        

        but in skylinesoft website is :

        HRESULT SetOptionParam(
        
                BSTR paramName,
        
                VARIANT paramVal)
        

        for C++. This function is simple, some other functions may be complex. If I use:

        QVariant QAxBase::dynamicCall(const char *function, QList<QVariant> &vars)
        

        to call the COM object's method function, which requires "If function is a method of the object, the string must be provided as the full prototype", for example,

        activeX->dynamicCall("Navigate(const QString&)", "www.qt-project.org");
        

        the function parameter's data type is Qt data type, so, I probably don't know ”the full function prototype".

        So, I want to use:

        QString QAxBase::generateDocumentation()
        

        to get the documentation for the wrapped COM object, which describes "the full function prototype".

        Second, "Is your parent QAxObject still "alive" and valid when you try to access the sub-object?",
        I think it is. If parent QAxObject is not valid, the should occur this line:

        QAxObject* anaObject = teObject->querySubObject("Analysis");
        

        but now it occurs next line:

        terraString = anaObject->generateDocumentation();
        

        Now, I use:

        #import TerraExplorerX.dll
        

        to generate "terraexplorerx.tlh" and "terraexplorerx.tli". By this way, I have to learn the COM data type and how the object instantiated using class generated by #import, interacts with QAxWidget, which can be embed as windows widget in user application.

        Thank you again for your encouragement!

        1 Reply Last reply
        1
        • P Pl45m4
          24 Feb 2021, 12:36

          @Wang-xiaohu

          Does it work if you pick one function from here (https://www.skylinesoft.com/hubfs/KB_Resources/TED/Web Help/Programmers Guide/index.htm?#t=Analysis_IAnalysis71.htm) and just call it?

          Is your parent QAxObject still "alive" and valid when you try to access the sub-object?

          W Offline
          W Offline
          Wang xiaohu
          wrote on 24 Feb 2021, 16:01 last edited by
          #4

          @Pl45m4
          "Is your parent QAxObject still "alive" and valid when you try to access the sub-object?"
          Yes you are right.
          when I added:

               teObject = teObject->querySubObject("Analysis");
               if (!teObject || teObject->isNull()) {
                   qDebug() << "NO  subobject!";
               }
          

          the output window: "NO subobject!".

          Why did this function return Null ?

          IAnalysis71 is not the subobject of SGWorld71 ?

          1 Reply Last reply
          0

          1/4

          24 Feb 2021, 11:45

          • Login

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