Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Component Object Model (COM) on non-Microsoft platforms

I'm regularly running into similar situations : I have a bunch of COM .DLLs (no IDL files) which I need to use and invoke to be able to access some foreign (non-open, non-documented) data format.

Microsoft's Visual Studio platform has very nice capabilities to import such COM DLLs and use them in my project (Visual C++'s #import directive, or picking and adding them using Visual Basic .NET's dialogs) - and that's the vendors recommended way to use them.

I would be interested into finding a way to use those DLLs on non-microsoft development platforms. Namely, using these COM classes in C++ project compiled with MinGW or Cygwin, or even Wine's GCC port to linux (compiles C++ targeting Win32 into binary running natively on Linux).

I have got some limited success using this driver, but this isn't successful in 100% of situations (I can't use COM objects returned by some methods).

Has someone had success in similar situations ?

like image 578
DrYak Avatar asked Sep 17 '08 15:09

DrYak


People also ask

Are COM objects still used?

Like the Wikipedia page on it? COM may be "old", but it's still the base of much of how Windows works. For example, if you want to access an Excel worksheet, you have to use COM.

What is the use of Component Object Model?

The Microsoft Component Object Model (COM) is a platform-independent, distributed, object-oriented system for creating binary software components that can interact. COM is the foundation technology for Microsoft's OLE (compound documents), ActiveX (Internet-enabled components), as well as others.

Where are COM objects stored?

Most COM servers (code implementing a COM object) are implemented in a DLL whose path is stored in the registry key e.g. under InprocServer32.


1 Answers

The problem with the Ole/Com Object Viewer packaged with Visual Studio and Windows SDKs is that it produces a broken .IDL out of the .DLL, which can't further be compiled by MIDL into a .H/.CPP pair.

Wine's own reimplementation of OleViewer is currently unstable and crashes when trying to use those libraries.

like image 70
DrYak Avatar answered Oct 06 '22 22:10

DrYak