Paul Clement said:
A COM callable wrapper is not a COM component.
It is the interface communication (or interop) layer
between COM and .NET managed code.
Well, I believe that some historical overview should be provided here.
COM objects and components take their origins from OLE 2.0 spec. OLE 2.0
spec. was a mix of everything related to Object Linking and Embedding (OLE)
and (new for OLE 2.0) OLE controls architecture. Since OLE and OLE controls
are COM based, COM definition was given by the same OLE 2.0 spec as well.
About 2-3 years later an attempt was made to move basic parts of COM
technologies in their own COM specification, without mentioning all OLE and
controls related stuff. Approximately the same time another group inside
Microsoft worked with OLE controls 95 specification that first used word
"component". Some times later OLE Controls 95 was renamed to ActiveX
controls.
According to the COM spec, COM object definition could be given following
way:
COM object is a program unit that implements IUnknown interface. COM spec
also provided description of binary layout (just standard C++ vtables
structure of IUnknown) that actually meant implementation IUnknown interface
plus it defined extra rules for parameters conversion and similar.
OLE Controls 95 spec (the origins of ActiveX controls) defined lightweight
OLE controls with only requirement that contol must implements IUnknown. It
was a big difference to classical OLE controls that required more than a
dozen interfaces with non-trivial protocol implementation. The same OLE
Controls 95 spec first used word "component" for describing these
lightweight OLE controls. The only addition for allowing COM object to be
called "COM component" is requirement of it create-ability. Ie. it "COM
component" COM object should be implemented together with another COM object
that implements IClassFactory interface and retiring an instance of COM
component from its implementation of IClassFactory::CreateInstance method.
..Net COM callable wrapper provides implementation of IUnknown interface.
..Net interop also provides implementation of IClassFactory interface for
using it from COM clients. You can use Regasm utility for registering your
..Net component for use from COM client application. You can also register
your .Net object as COM+ component that by its definition is also COM
component.
Your statement that one can't create COM components in .Net was TOTALLY
WRONG.
Please, take my word of advice and not argue with me about the subjects
related to COM and OLE as you don't have sufficient knowledge for that. If
you need background information regarding my familiarity with the subject,
please make a simple search for my name in Microsoft DCOM and ATL mailing
list archives. As well as you can search developmentors DOTNET (retired)
mailing list archives for background information about my knowledge of .Net
and COM interop related.
-Valery.