Results 1 to 5 of 5

Thread: ActiveQt, activeX return values from methods

  1. #1
    Join Date
    Dec 2010
    Posts
    44
    Thanks
    9
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default ActiveQt, activeX return values from methods

    Hi All,

    I am trying to wrap an activeX object with a QAxWidget and invoke some methods on it. I am able to invoke methods which have parameters and am able to get the return values. But for methods which do not have any parameter I am able to invoke them but am not able to get the return arguments. The following are the few ways I have tired it:

    eg: The active X object has methods:

    a. string getName()
    b string getAddress(int)

    Qt Code:
    1. void myWidget::check(CLASSID)
    2. {
    3. m_pAxWidget = new QAxWidget();
    4. bool b;
    5. b = connect(m_pAxWidget, SIGNAL(exception(int,QString,QString,QString)), this,
    6. SLOT(exception(int,QString,QString,QString)));
    7. setControl( CLASSID );
    8. }
    9.  
    10. void myWidget::readit()
    11. {
    12. QString ret;
    13. QMetaObject::invokeMethod(m_pAxWidget, "getName", Qt::DirectConnection,
    14. Q_RETURN_ARG(QString, ret));
    15. qDebug()<<ret; // prints an empty ""
    16.  
    17. ret = (m_pAxWidget->dynamicCall("getName")).toString();
    18. qDebug()<<ret; // prints an empty ""
    19. }
    To copy to clipboard, switch view to plain text mode 

    I have checked all over the place but couldn't locate anybody facing this problem or posting a solution for it.

    Sky

  2. #2
    Join Date
    Aug 2008
    Posts
    45
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ActiveQt, activeX return values from methods

    Hi!

    Shouldn't this:
    setControl( CLASSID );

    Be this:
    m_pAxWidget->setControl( CLASSID );

  3. #3
    Join Date
    Dec 2010
    Posts
    44
    Thanks
    9
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ActiveQt, activeX return values from methods

    Hi Joyer83,

    Oops!. Actually the class has a setControl which calls m_pAxWidget->setControl( CLASSID );

    Thanks,
    Sky.

  4. #4
    Join Date
    Aug 2008
    Posts
    45
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ActiveQt, activeX return values from methods

    Hmm, maybe you could then use debugger to check what happens inside the dynamicCall() method?

  5. #5
    Join Date
    Aug 2009
    Posts
    52
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ActiveQt, activeX return values from methods

    I think you should look at its manual which can be generated by following code

    Qt Code:
    1. QString html = m_pAxWidget->generateDocumentation ();
    To copy to clipboard, switch view to plain text mode 

    you can save to an .html file or show it in an QTextBrowser or webview.

Similar Threads

  1. Replies: 3
    Last Post: 7th October 2015, 19:43
  2. Replies: 10
    Last Post: 10th February 2011, 19:45
  3. Replies: 0
    Last Post: 20th December 2009, 15:37
  4. ActiveQt - How can I hide an ActiveX control ?
    By John82 in forum Qt Programming
    Replies: 2
    Last Post: 11th October 2009, 22:12
  5. ActiveQt: How to pass image to ActiveX object?
    By AndreasSchlempp in forum Qt Programming
    Replies: 2
    Last Post: 16th February 2009, 12:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.