I\'m having trouble with LoadLibrary() and getting an error that doesn\'t make sense to me:
::SetLastError(0);
m_hDll = ::LoadLibrary(szName);
if
I would suggest using Dependency Walker to find out which method is missing or what DLLs are required or missing.
Ok, here is my solution: we had a complex dependency system and among them there were two DLLs with the same name (i.e. server.dll
), but located on different paths.
When client.dll
was loaded with LOAD_WITH_ALTERED_SEARCH_PATH
, it seems, that windows wasn't able to figure out which one of server.dll
should be used in symbols resolution (both server.dll
were successfully loaded, of course).
The solution was quite easy: let the loaded dlls have unique names, i.e server-1.dll
and server-2.dll
.
I was getting the same error code after calling LoadLibrary(). Finally found through dependency walker that some dependencies of module (szName) were missing.