LoadLibrary in IE activex control

LoadLibrary in IE activex control

I write an Internet Explorer ActiveX control and need to load a dll in it.
Says my control's ocx file is "C:\\test.ocx", the dll file is "C:\\test.dll".

So i write a line of code like this:
HANDLE hDll = ::LoadLibrary("C:\\test.dll");

Since i have told it to load from the very path, and the dll is in same dir with my ocx, it should work perfectly.
but it always return: ERROR_MOD_NOT_FOUND (The specified module could not be found.)

Damned it, i try all kinds of parameters pass into LoadLibrary, i even sign the dll. It kept returning error.

I google a lot, no one tells why. Read MSDN carefully, nothing was found.

After a lot frustrating failure. I just try LoadLibraryEx like this:
HANDLE hDll = ::LoadLibraryEx("C:\\test.dll",NULL,LOAD_WITH_ALTERED_SEARCH_PATH);

It works.

Thank you Microsoft.

你可能感兴趣的:(LoadLibrary in IE activex control)