If you work with any COM Object Function like as (DirectX functions, ...)
CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void **)&pSysDevEnum);
CreateClassEnumerator(CLSID_VideoCompressorCategory, &pEnumCat, 0);
and some thing like this ... and get Error (or problem)
you must use of this function After Start Application and Before Quite (Reached on WM_QUIT message) Application...
- CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); OR CoInitialize(NULL);
- CoUninitialize();
خب اگه با DirectX يا هر COM ديگه اي کار مي کرديد و بعد از يه ساعت کپي و پيست کردن از MSDN ;-) بازم کار نمي کنه ... بابا اين دوتا رو اول و آخر برنامت بنويس راه ميفته
- CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); OR CoInitialize(NULL);
- CoUninitialize();
No comments:
Post a Comment