is there anyone familiar with COM? I met problem when changed project from MFC to Qt
-
Do you have several calls to CoInitializeEx ?
Are you properly calling CoUninitialize when you're done with your COM stuff ? -
Hi, what error do you get from your CoInitializeEx() call? Try something like:
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); qDebug() << hr;
@hskoglund that DLL with COM is not Qt program...
-
@hskoglund that DLL with COM is not Qt program...
@opengpu
Hi
then use std::cout to show the HRESULT.
It can give hints about why its not loading,.What im a bit puzzled about if that is the same DLL used in the MFC app, and you did not change
the actual DLL code. why should it then stop working? -
https://en.m.wikipedia.org/wiki/HRESULT describes tools to decode HRESULTs
-
@opengpu said in anyone familiar with COM? i met problem when changed project from MFC to Qt:
-2147417850
= 0x80010106
"This is a bug in the DLL you are using. A DLL should never call CoInitializeEx() on a thread that it didn't create. "
-
#include "stdafx.h" BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; }