Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Using COM object
Using COM object [message #15376] Fri, 18 April 2008 01:29 Go to next message
forlano is currently offline  forlano
Messages: 1207
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I'm trying to use an external library made by a COM object.
This is the first time I face such animal. It seems I must register it in some way. I remind to have seen a discussion about this topic in the past but I cannot find it with the search function.
In particular I would like to know if I can import it and how. In visual C++ the command seems to be
#import “<path>\my_library.dll”

Many thanks,
Luigi
Re: Using COM object [message #15379 is a reply to message #15376] Fri, 18 April 2008 09:27 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1207
Registered: March 2006
Location: Italy
Senior Contributor
forlano wrote on Fri, 18 April 2008 01:29

Hello,

I'm trying to use an external library made by a COM object.
This is the first time I face such animal. It seems I must register it in some way. I remind to have seen a discussion about this topic in the past but I cannot find it with the search function.
In particular I would like to know if I can import it and how. In visual C++ the command seems to be
#import “<path>\my_library.dll”

Many thanks,
Luigi


Is this http://www.ultimatepp.org/srcdoc$Core$DLI$en-us.html
what I am looking for a COM object?

Luigi
Re: Using COM object [message #15393 is a reply to message #15376] Sun, 20 April 2008 16:12 Go to previous messageGo to next message
tvanriper is currently offline  tvanriper
Messages: 85
Registered: September 2007
Location: Germantown, MD, USA
Member
I do not think so... the .dli mechanism looks to me as if it is intended to be used with arbitrary DLLs and the functions they expose.

I've bound to COM objects using Ultimate++ before, at my job. Basically, I sorta cheated.

I had another project in Microsoft Visual C++ that used the COM objects I wanted to use. These generated a .c and .h file that provided the bindings I needed for the COM object. I simply pulled these into my Ultimate++ project.

This said, I should think you ought to be able to use the #import trick if the DLL in question supports it. You'll need to include the right headers to make use of it (I can't recall what they are right now, and I'm at home... won't be back to work for a week or so). And, honestly, I haven't really tried it.
Re: Using COM object [message #15394 is a reply to message #15376] Sun, 20 April 2008 16:14 Go to previous messageGo to next message
tvanriper is currently offline  tvanriper
Messages: 85
Registered: September 2007
Location: Germantown, MD, USA
Member
I should be more specific...

The MIDL compiler generated the .c/.h files from another file in my Visual C++ project.

I don't know if Ultimate++ supports this very well, although you can use third-party tools in Ultimate++.
Re: Using COM object [message #61591 is a reply to message #15379] Thu, 20 March 2025 20:23 Go to previous message
JeyCi is currently offline  JeyCi
Messages: 67
Registered: July 2020
Member
I'm not sure, that given link is what you need -- - it sems to be just prototype of this -- yes, you can import functions from Dll (that you can see with Dependency Walker), but from COM these will be those from vtbl (virtual table, - an array of function pointers) that in COM just give access to the COM-container/wrapper (like DllInstall, DllGetClassObject, DllRegister - aka some general stuff), and from virtual interface(s) of COM, some of which acts as Class Factory, you implement class(es) itself with its methods ==> thus, declaration of FN in DLI seems dobtfull for me, but I didn't yet experiment with Dl class from here

C-classes-from-a-DLL (incl. COM)


Best regards.

[Updated on: Thu, 20 March 2025 20:27]

Report message to a moderator

Previous Topic: Umk fails to download UppHub packages on Windows (git.exe not found error)
Goto Forum:
  


Current Time: Fri Apr 25 07:53:58 CEST 2025

Total time taken to generate the page: 0.02777 seconds