-
December 5th, 2001, 06:03 AM
#1
Error while executing Load library
Im encounrering the error "specified module not found" error(ERROR_MOD_NOT_FOUND) while executing the load library function.
how to proceed?
-
December 5th, 2001, 06:23 AM
#2
Re: Error while executing Load library
you must place your dll either in the path ur executing the exe or in the windows -> system folder for the LoadLibrary to function.
VCVCVC
"Dont Forget to rate if it helped"
-
December 5th, 2001, 06:38 AM
#3
Re: Error while executing Load library
DLL path is hardcoded and the DLL exists in the specified path. I have checked all other possibilities of path settings. At times this gives an error of "Specified procedure could not be found" instead of "Specified module could not found". Please provide me any other sugeestions.
-
December 5th, 2001, 06:48 AM
#4
Re: Error while executing Load library
HMODULE gLibMyDll = NULL;//Initialize this first in the starting of the file
if (gLibMyDll != NULL)
{
MessageBox("Already Loaded");
return;
}
gLibMyDll = :: LoadLibrary ("MyDll.dll");//your dll name
if (gLibMyDll == NULL )
{
char msg[300];
strcpy(msg,"cannot load dll");
strcat(msg,"check dll");
MessageBox(msg);
}
check out this handling whether ur able to load or not
VCVCVC
"Dont Forget to rate if it helped"
-
December 5th, 2001, 06:53 AM
#5
Re: Error while executing Load library
This is my code:
HMODULE hMod = LoadLibrary(c:\\Docmgnt\\Docmgnt.dll"));
LPVOID lpMessageBuffer;
FormatMessage
(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMessageBuffer,
0,
NULL);
char *err_msg = (char*)lpMessageBuffer;
MessageBox(NULL,err_msg,"Message",MB_OK);
LocalFree( lpMessageBuffer );
DLL path is hardcoded
-
December 5th, 2001, 06:56 AM
#6
Re: Error while executing Load library
in the def file of the dll u might not have specified the function name.pls do that and compile and then load the dll.also check out with the _declspec(dllexport).
VCVCVC
"Dont Forget to rate if it helped"
-
December 5th, 2001, 07:00 AM
#7
Re: Error while executing Load library
This DLL works perfectly with applications developed in VC++ 5.0. When i compiled and linked the same DLL in VC++ 6.0 and and used with applications developed in VC++6.0, it gives me error. rather load llibrary returd null. i havent made any code changes, just i compiled and liked the dll in VC++60
-
December 5th, 2001, 07:06 AM
#8
Re: Error while executing Load library
These are all the possiblilites given in MSDN did u check with these.
Windows 95/98/Me: If you are using LoadLibrary to load a module that contains a resource whose numeric identifier is greater than 0x7FFF, LoadLibrary fails. If you are attempting to load a 16-bit DLL directly from 32-bit code, LoadLibrary fails. If you are attempting to load a DLL whose subsystem version is greater than 4.0, LoadLibrary fails. If your DllMain function tries to call the Unicode version of a function, LoadLibrary fails.
VCVCVC
"Dont Forget to rate if it helped"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|