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. Qt ActiveX Example
Forum Updated to NodeBB v4.3 + New Features

Qt ActiveX Example

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 1.2k 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.
  • kwebster83K Offline
    kwebster83K Offline
    kwebster83
    wrote on last edited by
    #1

    Hi,

    I'm trying to get a set of ActiveX classes and controls working in Qt however I'm not having much success.

    Firstly, I've used dumpcpp to create the relevant .h and .cpp files from the typelib:

    dumpcpp "C:\EncXCOM.dll"
    

    I've imported the resulting files into my Qt Widgets application. From this point onwards, I struggle. Having attempted to follow various tutorials on the web, I still can't successfully instantiate any of the classes or objects contained within.

    Taking a working example from Delphi (urgh, I know), I can do the following successfully:

    CoInitialize(nil);
    CoCreateInstance(CLASS_Library_, nil, CLSCTX_INPROC_SERVER, IID_ILibrary, fLibrary);
    // The following call works successfully
    fLibrary.Construct("", "");
    

    Where CLASS_Library_ and IID_ILibrary are GUIDs, fLibrary is an interface which I'm able to successfully call methods on following the CoCreateInstance call.

    In Qt, I'm not entirely sure what the equivalent to the above. My code as it exists at the moment is:

    ENCX::Library *lib = new ENCX::Library();
    // The following call generates these errors: 
    // CoCreateInstance failure (CoInitialize has not been called)
    // QAxBase::qt_metacall: Object is not initialized, or initialization failed error
    lib->Construct("", "");
    

    Please could someone offer some suggestions as to where I'm going wrong?

    I appreciate that this is probably a very incorrect way to achieve what I'm wanting.

    Kind regards,
    Kevin

    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