PDA

View Full Version : Problem with a com object, I need help



franco.amato
12th April 2010, 16:41
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

ChrisW67
12th April 2010, 22:32
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) (http://qt.nokia.com/doc/4.6/activeqt-webbrowser.html) 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()

franco.amato
12th April 2010, 23:01
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) (http://qt.nokia.com/doc/4.6/activeqt-webbrowser.html) 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

ChrisW67
13th April 2010, 00:17
Yes you need to register the COM DLL, something like
C:\Windows\System32> regsvr32 PallyCOM.dll

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