DLL Loading Problem

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.
 
I

Ian Collins

Hi, everyone. I have a problem with loading a dll in my program using
LoadLibrary( LibaryName ).

Try a windows group, this is an OS issue rather than a C++ one.
 
A

Alex

(e-mail address removed) kirjutas:




So, what problem it was? Probably off-topic here anyway, but as long as you
have not told us, we can never know.

(OT remark: for finding out some loading problems with Windows dll-s you
can use Dependency Walker).

Paavo

try following command
/////////////////////
dumpbin /exports "your dll name"
/////////////////////
and check the "ordinal" and "name"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top