Note that there are some explanatory texts on larger screens.

plurals
  1. POcall to LoadLibrary from ATL COM plug-in
    text
    copied!<p>Hi I have an ATL based COM plugin and there is another 3rd party library that I want to use. It's not COM dll and implemented in C++.</p> <p><strong>details on 3rd party dll as follows:</strong></p> <p>Configuration type = Dynamic Library(.dll)</p> <p>Use of MFC = Use MFC in a static library</p> <p>Use of ATL = not using ATL</p> <p>Character set = use multi-btye char set</p> <p>CRL support=no clr support</p> <p><strong>details on COM dll project as follows:</strong></p> <p>Configuration type = Dynamic Library(.dll)</p> <p>Use of MFC = Use MFC in a shared library</p> <p>Use of ATL = dynamic link to ATL</p> <p>Character set = use unicode char set</p> <p>CRL support=no clr support</p> <p>This is my code</p> <pre><code>HRESULT FinalConstruct() { LPCWSTR libPath = _T("LicEnf.dll") ; const char * clibPath = "LicEnf.dll" ; SetLastError(0); HMODULE hMod = LoadLibraryA(clibPath); if(hMod==NULL) { LOG4CXX_TRACE(CALMLogger::GetModuleLogger(ModuleName), _T("Could not load library:GetLastError() returned ") &lt;&lt; GetLastError()); } return S_OK; } </code></pre> <p>FinalConstruct is called 3times. hMod always 0 and on the log file i have</p> <blockquote> <p>Could not load library:GetLastError() returned 183</p> <p>Could not load library:GetLastError() returned 126</p> <p>Could not load library:GetLastError() returned 126</p> <p>where </p> <p>-183 (0xB7) =ERROR_ALREADY_EXISTS</p> <p>-126 (0x7E) =ERROR_MOD_NOT_FOUND</p> </blockquote> <p>On the other hand if I call this code from another test application which is an ordinary exe file , loadLibrary works fine. Is there any limitation of loading a native win32 dll from COM-dll and what's my mistake here ?</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload