Hi,
I am unable to load my test.dll (in VC++ - MFC) using LoadLibrary()
API. I get error code 126 (Module not found)
using GetLastError()
.
By dependency walker I have come to know that my test.dll depends on "xerces-c_2_7.dll" and "Xalan-C_1_10.dll". These dlls were already present on the same path as the exe.
Still I am getting the error.
So I tried to load both the above mentioned third party dlls using LoadLibrary()
which returned handle as 0x10000000
. By GetLastError()
I am getting
error code 6 (Invalid Handle).
Can anyone please guide me on why I am getting the Invalid Handle error?
Below is the code snipet:
HINSTANCE hLib = LoadLibrary(_T("Xalan-C_1_10"));
TCHAR szMessage[MAX_PATH];
FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS|
FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
szMessage, MAX_PATH, NULL);
hLib = LoadLibrary(_T("xerces-c_2_7"));
FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS|
FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
szMessage, MAX_PATH, NULL);