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. [Solved]ActiveQt - Problem with querySubObject

[Solved]ActiveQt - Problem with querySubObject

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

    Hi,

    I am using a OPC Automation library for accessing data from a OPC Server.

    Here is the code so far:
    @ QAxObject *server=new QAxObject("Matrikon.OPC.Automation.1");
    if(server && !server->isNull())
    {
    //Matrikon simulation opc server
    QString uuidServer="{F8582CF2-88FB-11D0-B850-00C0F0104305}";
    server->dynamicCall("Connect(QString)",uuidServer);

        qDebug()<<server->dynamicCall("VendorInfo()").toString();
    
        QAxObject *groups = server->querySubObject("OPCGroups()");
    
        if(groups && !groups->isNull())
        {
            qDebug()<<groups->dynamicCall("Count()");
            qDebug()<<groups->dynamicCall("VendorInfo()");
        }
    

    }@

    The problem is, that the groups object seems to be pointing to the server object.
    To test this I called the Count()-method of the OPCGroups class and the VendorInfo()-method of the OPCServer class on the groups object.
    Both calls to VendorInfo() succeeded, whether I called it on the server object or on the groups object.
    But calling count() on the groups object gave me the following error:
    @QAxBase::dynamicCallHelper: Count(): No such property in [unknown]
    Candidates are:
    ClientName
    CurrentTime
    control@

    I already made a test application in .Net without problems, so I think the typelibrary is working correctly.

    What could be the problem here?
    Might this be a bug in the querySubObject function?

    Thanks,
    Christian

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

      I worked around this problem by using queryInterface instead of dynamicCalls.

      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