1. COM Basics
1.1. Service Control Manager (SCM)
A Windows program called Service Control Manager (SCM) does most of the job in COM server invoking. It finds the server through System Registry, runs it, has it create the COM object, sets up local/remote transparency, and returns an interface pointer to the client.
Then the client can directly invoke methods of the COM object through the pointer, and there is no middleware involved unless it is a remote server, in which case only RPC is involved.
1.2. Interface IUnknown
All COM interfaces should inherit interface IUnknown:
interface IUnknown
{
HRESULT QueryInterface(REFIID iid, void** ppvObject);
ULONG AddRef();
ULONG Release();
}
One COM object
may be used by multiple clients. The COM server maintains a reference count for
each interface of the object. When one client asks to create an instance of the
interface with CoCreateInstance or CoCreateInstanceEx, the COM
server will call that interface



















