I am developing a DLL to handle Optitrack camera model flex c:120.
Due to the use of other libraries, I am forced to initialize the COM objects using CoInitializeEx(NULL, COINIT_MULTITHREADED); instead of CoInitialize(NULL);
This causes a memory exception when calling the GetFrameImage function of INPCamera.
I get the same behaviour when modify the "GrayscaleSample".
Code: Select all
......
int main()
{
//== Initialize Microsoft COM Interop ===============----
//CoInitialize(NULL);
HRESULT hResult = CoInitializeEx(NULL, COINIT_MULTITHREADED);
//HRESULT hResult = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
......
(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)). Is there any way I can use the COM as MULTITHREADED?