Results 1 to 4 of 4

Thread: Problem with a com object, I need help

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    692
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem with a com object, I need help

    Hi to all,
    Is lots of time that I trying to use a com dll into my c++/qt app, but I doesn't understand how can I get the function pointers.
    For example I have mydll.dll and I would run it's functions.
    I read about ActiveQt and I read the example. There is an example "comapp" that I think it use a com object but in the
    code I don't understand where it load a com dll and where it execute it's routines.
    Please help me:
    I need to load a com dll and get its routines pointer.

    Thank you in advance
    Franco Amato

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with a com object, I need help

    The Com App example show how to make your Qt application accessible as an COM object elsewhere is Windows e.g. so it can be scripted with VBA.

    The Web Browser Example (ActiveQt) is probably closer to what you want. The Internet Explorer ActiveX control is embedded (linked using its GUID) in the UI file for the main window and its methods are accessed using QAxBase::dynamicCall()

  3. #3
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    692
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with a com object, I need help

    Quote Originally Posted by ChrisW67 View Post
    The Com App example show how to make your Qt application accessible as an COM object elsewhere is Windows e.g. so it can be scripted with VBA.

    The Web Browser Example (ActiveQt) is probably closer to what you want. The Internet Explorer ActiveX control is embedded (linked using its GUID) in the UI file for the main window and its methods are accessed using QAxBase::dynamicCall()
    Hi thank you very much.
    What's the GUID and how can I get it?
    I only have the name of the dll ( PallyCOM.dll I think it's been written in Visual basic)
    I also read that I have to register the dll right?

    I hope you can help me as I'm pulling my hairs
    Franco Amato

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with a com object, I need help

    Yes you need to register the COM DLL, something like
    Qt Code:
    1. C:\Windows\System32> regsvr32 PallyCOM.dll
    To copy to clipboard, switch view to plain text mode 

    I'm not sure if the connection is made by name or GUID in Designer (don't have a Windows machine handy) when you put the container on the form. The Name/GUID should be easily found in PallyComs documentation, examples etc. If you have a VB6 example then open the FRM file with a text editor and have a look. The GUID is in that abomination called the Windows registry. Human-friendly names are the keys in HKEY_CLASSES_ROOT, which refer to GUIDs that can be found under HKEY_CLASSES_ROOT\CLSID.

    This is about the limit of my knowledge.

    Added:
    Have a look at QAxBase::control() for other ways to identify the control
    Last edited by ChrisW67; 13th April 2010 at 00:32. Reason: More info

Similar Threads

  1. Object::Connect problem
    By geleven in forum Qt Programming
    Replies: 3
    Last Post: 6th April 2010, 02:38
  2. Problem to recover an object via a QAction
    By Potch in forum Qt Programming
    Replies: 2
    Last Post: 4th July 2008, 11:19
  3. Saving a QPixmap Object problem
    By StrikerX in forum General Programming
    Replies: 4
    Last Post: 15th November 2007, 02:19
  4. Problem with my object hierarchy
    By rage in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2007, 09:18
  5. Can't create an object : initialisation problem ?
    By Nyphel in forum Qt Programming
    Replies: 5
    Last Post: 12th March 2007, 09:07

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.