Y
yxyworld
Hi, everyone. I have a problem with loading a dll in my program using
LoadLibrary( LibaryName ). I'm only having that problem with a
particular dll and never had that problem before. All of my other dlls
are loadable and usable without problems. No significant changes have
been made since the last successful use of the dll in my exe. Here's
the general format of my dll and all my other dlls:
#include <windows.h>
#include <stdio.h>
#include <math.h>
#include <ctime>
#include <cstdlib>
/*
(global constants and some global variables here)
(function and class declarations here)
(global variables here)
*/
#ifdef __cplusplus
extern "C" {
#endif
__declspec(dllexport) void __cdecl SomeFunction1( /* arguments */ )
{
// bla bla bla
}
// the list continues...
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
#ifdef __cplusplus
}
#endif
To exclude the possibility that something was wrong in my main program
that caused the error, I've made a simple console program that just
loads the dll using LoadLibrary(), and as expected it returned NULL.
I've tried using GetLastError after the dll failed to load but it just
returned a 0. One of the possible causes that I can think of is my
recent installation of SP3 for WinXP on my PC. Any suggestions and/or
solutions are greatly appreciated.
LoadLibrary( LibaryName ). I'm only having that problem with a
particular dll and never had that problem before. All of my other dlls
are loadable and usable without problems. No significant changes have
been made since the last successful use of the dll in my exe. Here's
the general format of my dll and all my other dlls:
#include <windows.h>
#include <stdio.h>
#include <math.h>
#include <ctime>
#include <cstdlib>
/*
(global constants and some global variables here)
(function and class declarations here)
(global variables here)
*/
#ifdef __cplusplus
extern "C" {
#endif
__declspec(dllexport) void __cdecl SomeFunction1( /* arguments */ )
{
// bla bla bla
}
// the list continues...
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
#ifdef __cplusplus
}
#endif
To exclude the possibility that something was wrong in my main program
that caused the error, I've made a simple console program that just
loads the dll using LoadLibrary(), and as expected it returned NULL.
I've tried using GetLastError after the dll failed to load but it just
returned a 0. One of the possible causes that I can think of is my
recent installation of SP3 for WinXP on my PC. Any suggestions and/or
solutions are greatly appreciated.