views:

247

answers:

5

Hello,

I was searching through google about Microsoft Component Object Model. Found only few normal articles and only 1 step by step example, which doesn't work. Is there any links/references/books/tutorials you know how to build simple COM component via VS C++? Any answer or help would be appreciated!

+2  A: 

Start with reading

Essential COM by Don box

a must read for anyone who wants to do COM development.

fretje
+2  A: 

COM is generally considered antiquated technology these days. That's not to say nobody is still using it - there are plenty of legacy systems that are still invested in it - but it's rare to find someone approaching it as a newbie nowadays.

I'm not sure if things have moved on much but my recommendations would be Don Box's Essential COM and ATL Internals .

Actually my overriding recommendation would be to avoid it if you can :-)

Phil Nash
What alternative would you recommend? (I ask because I'm a Java guy, not .NET.)
duffymo
That depends what your goal here is. In general COM, as a technology, has been superseded by .Net as the tool of choice for building Component-based designs on Windows. Other options could be web services (or RESTful services) at the higher-end, or raw sockets (perhaps using an async IO framework such as Boost ASIO) at the low end
Phil Nash
A: 

Inside Com - Dale Rogerson is a classic book and also code project has good examples on it:

http://www.codeproject.com/KB/COM/comintro.aspx

Ashish
A: 

MSDN provides a tutorial for building com with ATL here: http://msdn.microsoft.com/en-us/library/599w5e7x%28VS.71%29.aspx

It should be good material for getting start.

Raymond
A: 

If you don't have a really good reason to learn COM, I suggest getting into .NET instead. COM a legacy technology, which still lives with us, and sometimes we need to maintain software that use it, or interoperate with it. But there is no good reason to use it for brand new development, in my opinion.

Some COM weaknesses:

  • Message pumping
  • Reference counting (caused problems with circular references)
  • DLL hell

I read somewhere that .NET was first called COM 2.0 internally (sorry, I couldn't find a reference), but later on it has grown into a much more complete platform. It has overcome COM's weaknesses, and provides a great class library.

Tamás Szelei
1. Saying "COM Weaknesses" without specifying what those are seems like fanboy-ism to me. 2. COM is still required for browser helper objects, object linking and embedding, shell extensions, etc. It's not going away any time soon.
Billy ONeal
Hi BillyONeal, I have listed some actual weaknesses. I really didn't mean to be "a fanboy", and I don't think that it is possible to be a ".NET-fanboy" "against" another MS-technology which is the predecessor of the later.
Tamás Szelei