Results 1 to 3 of 3

Thread: Active Qt. Objects that imported from VirtualBox.tlb could not be instantiated

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Active Qt. Objects that imported from VirtualBox.tlb could not be instantiated

    Hi Qt Funs!

    I have started developing on Qt this week and second day as I stopped on binging VirtualBox COM API to Active Qt.

    VirtualBoxClient is created well by non-Active Qt, classic way:
    Qt Code:
    1. ...
    2. #include "d:\sources\algorithms\comtest2\comtest2\debug\virtualbox.tlh"
    3. ...
    4. CLSIDFromProgID(OLESTR("VirtualBox.VirtualBoxClient"), &clsid);
    5. IVirtualBoxClient *virtualBoxClient = nullptr;
    6. hr = CoCreateInstance(clsid, nullptr, CLSCTX_INPROC_SERVER, __uuidof(IVirtualBoxClient), (void**)&virtualBoxClient);
    7. if (FAILED(hr) || virtualBoxClient == nullptr) {
    8. ...
    To copy to clipboard, switch view to plain text mode 

    But how to do it in Qt style? Step by step:
    1) The following lines are added to a project file:
    QT += widgets axcontainer
    TYPELIBS = $$system(dumpcpp VirtualBox.tlb -n vbox )
    vbox.h and vbox.cpp are generated without an error.
    2) lines in main.cpp:
    Qt Code:
    1. #include "vbox.h"
    2.  
    3. using namespace vbox;
    4.  
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. QCoreApplication a(argc, argv);
    9. vbox::VirtualBox v ;
    10. qDebug() << v.isNull();
    11. vbox::VirtualBoxClient client;
    12. qDebug() << client.isNull();
    To copy to clipboard, switch view to plain text mode 
    Output:
    CoCreateInstance failure (CoInitialize has not been called.)
    QAxBase::setControl: requested control {b1a7a4f2-47b9-4a1e-82b2-07ccd5323c3f} could not be instantiated
    true
    CoCreateInstance failure (CoInitialize has not been called.)
    QAxBase::setControl: requested control {dd3fc71d-26c0-4fe1-bf6f-67f633265bba} could not be instantiated
    true

    Could you show me the right way?
    Attached Files Attached Files
    Last edited by minskster; 13th January 2017 at 17:14.

Similar Threads

  1. QAxWidget - my controler could not be instantiated
    By ArnaudC in forum Qt Programming
    Replies: 3
    Last Post: 17th January 2013, 18:33
  2. VirtualBox compiling is %100 safe
    By selametting in forum Newbie
    Replies: 2
    Last Post: 17th August 2012, 07:38
  3. Replies: 4
    Last Post: 28th March 2011, 16:29
  4. Access instantiated objects from C++
    By Sunny31 in forum Qt Quick
    Replies: 3
    Last Post: 5th December 2010, 17:25
  5. ActiveQt : requested control could not be instantiated
    By zirconius in forum Qt Programming
    Replies: 2
    Last Post: 9th April 2010, 13:27

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.