skip to main content
Interface Provider API : Reference : OAIP_connectW (Unicode version) : Using COM Objects from the IP
 
Using COM Objects from the IP
If your IP is using a Microsoft Component Object Model (COM) object, you should perform the CoInitialize call during CONNECT and call CoUninitialize during DISCONNECT. In a local configuration, a client application may already have called CoInitializeEx with a specific thread model. In this case, CoInitialize returns an error RC=RPC_E_CHANGED_MODE which means that COM has already been initialized on that thread. The IP should keep a flag for each connection indicating whether a successful CoInitialize was performed so that it can call CoUninitialize during DISCONNECT.
For information on the Microsoft COM CoInitialize function, visit:
http://msdn2.microsoft.com/en-us/library/ms678543.aspx