COM and ATL supporT in minGW

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

COM and ATL supporT in minGW

Taimoor Mirza
Hi all,
I have a COM server component and I want to develop its client. This COM component also has out bound interface through which it can communicate with its client
Now I want to know that does minGW support COM? If yes then to what extent?
Can I develop such a COM client and build it using minGW 5.1.3 toolset?
Does minGW also directly/indirectly support ATL?
 
Regards,
Taimoor


Connect to the next generation of MSN Messenger  Get it now!
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: COM and ATL supporT in minGW

Brian Dessent
Taimoor Mirza wrote:

> I have a COM server component and I want to develop its client. This
> COM component also has out bound interface through which it can
> communicate with its client
> Now I want to know that does minGW support COM? If yes then to what
> extent?
> Can I develop such a COM client and build it using minGW 5.1.3
> toolset?

Yes, you can write COM controls with MinGW.  While the C++ ABIs of the
MS compiler and gcc are not compatible (which would ordinarily mean you
can't mix C++ code between them) COM is not fundamentally C++ based but
rather implemented with generic vtables which are just arrays of
function pointers, so it doesn't matter that the name mangling is
incompatible.  You can also write COM in straight C, though it requires
a little more knowledge of how things work.  See for example the series
"COM in Plain C":
<http://www.codeproject.com/info/search.aspx?artkw=%22com%20in%20plain%20c%22>.

You might also have to use some tools from the MS PSDK that don't have
corresponding MinGW implementations, such as the midl tool to create
headers, e.g.
<http://article.gmane.org/gmane.comp.gnu.mingw.user/16647>.

> Does minGW also directly/indirectly support ATL?

Well for one thing it's MS proprietary so you would need to already own
a copy of Visual Studio to legally have the required headers and
library.  In theory if you did you could try using them with gcc but I
suspect you'd run into problems with the headers using MS-specific
extensions like #pragma and MS-style inline assembler that gcc does not
support.  Also, due to the C++ ABI incompatibility you'd have to rebuild
the whole lib and statically link it because you wouldn't be able to
link with the ATL DLLs.  All in all I'd say this means it's impossible,
or at least extremely impractical.

Brian

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: COM and ATL supporT in minGW

Cristian Adam-3
In reply to this post by Taimoor Mirza
Taimoor Mirza wrote:
> Hi all,
> I have a COM server component and I want to develop its client. This COM
> component also has out bound interface through which it can communicate
> with its client
> Now I want to know that does minGW support COM? If yes then to what extent?
> Can I develop such a COM client and build it using minGW 5.1.3 toolset?
> Does minGW also directly/indirectly support ATL?
>  

MinGW doesn't support ATL. ATL is a C++ Microsoft proprietary library.

You might use the COM C interface in MinGW for it's client. As far
as I know MinGW doesn't have any C++ COM smart pointers implemented.

You can use boost (or std::tr1) shared_ptr to have a C++ smart pointer
library -
http://www.boost.org/doc/libs/1_36_0/libs/smart_ptr/sp_techniques.html#com

You might want to try Comet (http://www.lambdasoft.dk/comet/)
"Comet is language binding between COM and C++. It allows you to do both
COM client and COM server programming, without any dependency on either
ATL or MFC. In other words Comet is a replacement for ATL."

Another promising project is VOLE (http://vole.sourceforge.net/)
"VOLE is an open-source C++ library that dramatically simplifies the
business of driving COM servers (via the IDispatch interface) from C++."

The latter is actively more maintained.

Best of luck,
Cristian.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users