Making calls to COM, which are single threaded

In order to make calls to a COM method which is implemented using a single threaded model, you would need to use the CoInitialize Function.
This basically Initializes the COM library on the current thread and identifies the concurrency model as single-thread apartment (STA).
Format is as below:
HRESULT CoInitialize(
__in_opt LPVOID pvReserved
);
Newer applications can use:
CoInitializeEx(0, COINIT_APARTMENTTHREADED);

Leave a Reply

Your email address will not be published. Required fields are marked *