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. Is that possible to get an array of com+ objects from QAxObject?
Forum Update on Monday, May 27th 2025

Is that possible to get an array of com+ objects from QAxObject?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.1k 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.
  • A Offline
    A Offline
    alexKI
    wrote on 11 Mar 2011, 08:48 last edited by
    #1

    Example of what I do on "ISldWorks":http://help.solidworks.com/2010/english/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ISldWorks.html:

    @ QAxObject *sw = new QAxObject("SldWorks.Application", this);

    int i2 = sw->dynamicCall("GetDocumentCount()").toInt(); //return 3
    QVariant c = sw->dynamicCall("GetDocuments()");
    //debug mode and typeName() confirm that c is QVariantList with 0 items
    QVariantList cList = c.toList();
    
    sw->dynamicCall("SendMsgToUser(QString)", QString::number(cList.count()) + " - " + QString::number(i2));@
    

    it shows 0 - 3, 0 objects in cList, and 3 really should be.

    PS When I tryed this algorithm in C#.Net it worked (3 - 3):
    @ int count = (int)sw.GetType().InvokeMember("GetDocumentCount", BindingFlags.InvokeMethod, null, sw, null);
    object[] models = (object[])sw.GetType().InvokeMember("GetDocuments", BindingFlags.InvokeMethod, null, sw, null);

            //models are operable (I tryed)
            System.Windows.Forms.MessageBox.Show(models.Count().ToString() + " - " + count.ToString());@
    
    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexKI
      wrote on 15 Mar 2011, 08:52 last edited by
      #2

      post it here "QAxBase have no implements to query array of sub objects":http://bugreports.qt.nokia.com/browse/QTBUG-18131

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AndyS
        Moderators
        wrote on 5 May 2011, 14:22 last edited by
        #3

        I am not sure that your situation is a bug at the moment, since it seems that the object needs to be casted in order to get an array of them. If you use dumpdoc on the control then can you paste in the relevant part of documentaton that shows what it says for the GetDocuments() function? Thanks.

        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        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