When a COM class has a type library that has been converted to metadata by the Type Library Importer utility (TlbImp), it appears to the NGWS client exactly like any other NGWS class. The client creates a new instance in the usual way, and it obtains class information through metadata as it would for any other NGWS class. Method syntax can be exposed through an object viewer or obtained using reflection, just as it can with any other NGWS class. When the COM object returns a failure HRESULT, the NGWS client catches a corresponding exception. Obtaining and releasing a reference to a running COM object is just like obtaining and releasing a reference to any other running NGWS object. When NGWS clients obtain and release references to a COM object, the NGWS runtime maintains the reference count on the COM object just as any other COM client would, and NGWS clients can behave as if the object were subject to garbage collection, just as they would for any other NGWS server object.
For COM objects with no type library, you must instantiate a special class called __COMObject. __ComObject, an internal class in the System namespace, is derived from MarshalByRefObject. __ComObject is the root class for all COM wrappers, which wrap COM objects accessed from the NGWS runtime. This class defines only the basics, and exists solely to make COM classes with no type library available to NGWS clients.
This section explains the following topics: