gsdll.hmodule = LoadLibrary(szDllName);
if (gsdll.hmodule < (HINSTANCE)HINSTANCE_ERROR)
return FALSE;
..
..
This code is in another dll but I can't see why that should be a problem.
Loadlibrary returns an error code - 1114 (A dynamic link library (DLL)
initialization routine failed).
When I use the same code in another application (exe) there is no problem.
What is the problem?
Also note that LoadLibrary(..) return value test has changed in 32-bit
world.
You should check for NULL { if ( gsdll.hmodule == NULL ) } instead of
if (gsdll.hmodule < (HINSTANCE)HINSTANCE_ERROR)
[ See LoadLibrary documentation ]
and use GetLastError(..) to get the error information.
Cheers
Check Abdoul
------------------
"Jacob Ignatius" <jac...@ais.co.uk> wrote in message
news:eWLOIZJCBHA.988@tkmsftngp07...
"Jacob Ignatius" <jac...@ais.co.uk> wrote in message
news:eWLOIZJCBHA.988@tkmsftngp07...
I checked for NULL too and I keep getting NULL.
I don't know what to do.
CheckAbdoul <check...@yahoo.com> wrote in message
news:#rYDSkKCBHA.2116@tkmsftngp02...
the (HINSTANCE)HINSTANCE_ERROR) is old Win16-style code and is
obsolete. Read the documentation of LoadLibrary.
joe
On Mon, 9 Jul 2001 17:38:36 +0100, "Jacob Ignatius" <jac...@ais.co.uk>
wrote:
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm
HMODULE module = LoadLibrary(name);
if(module == NULL)
{
DWORD err = ::GetLastError();
.... report error here
return FALSE;
}
How you report the error is up to you. Alternatively, just return
FALSE and the caller can call ::GetLastError and report the error. If
you set a breakpoint on the return FALSE, set a watch on
@ERR,hr
and it will display the error code and message in the watch window.
joe
On Mon, 9 Jul 2001 17:38:36 +0100, "Jacob Ignatius" <jac...@ais.co.uk>
wrote:
>I am trying to load a dll with the LoadLibrary function:
Joseph M. Newcomer [MVP]