LoadLibrary

hi,

I have a rather peculiar situation. I am writing a application that
determines which DLL needs to be loaded at run-time. I use LoadLibrary Win32
API to load the needed DLL at runtime.
LoadLibrary fails to load the dll even though the DLL is present in the
location. GetLastError returned me '126' : The sepcified module could not be
found.
I am loading an MFC Application Extension DLL through a COM. The COM is
invoked through a ASP. That means the DLL is to be loaded in the
InetInfo.exe.
LoadLibrary does not fail for dlls other than Application Extension DLLS.
Please can anyone help me out

Regards,
Ganesh


0
9/17/2003 10:36:48 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
781 Views

Similar Articles

[PageSpeed] 8

Hello

Probably the other dependencies that your DLL is using are missing.

-- 
Elias
http://lgwm.org/
"Ganesh Amle" <ganeshamle@assetlink.com> wrote in message
news:eehF4aQfDHA.460@TK2MSFTNGP12.phx.gbl...
> hi,
>
> I have a rather peculiar situation. I am writing a application that
> determines which DLL needs to be loaded at run-time. I use LoadLibrary
Win32
> API to load the needed DLL at runtime.
> LoadLibrary fails to load the dll even though the DLL is present in the
> location. GetLastError returned me '126' : The sepcified module could not
be
> found.
> I am loading an MFC Application Extension DLL through a COM. The COM is
> invoked through a ASP. That means the DLL is to be loaded in the
> InetInfo.exe.
> LoadLibrary does not fail for dlls other than Application Extension DLLS.
> Please can anyone help me out
>
> Regards,
> Ganesh
>
>


0
lallous (134)
9/17/2003 12:11:18 PM
Reply:

Similar Artilces:

LoadLibrary
hi, I have a rather peculiar situation. I am writing a application that determines which DLL needs to be loaded at run-time. I use LoadLibrary Win32 API to load the needed DLL at runtime. LoadLibrary fails to load the dll even though the DLL is present in the location. GetLastError returned me '126' : The sepcified module could not be found. I am loading an MFC Application Extension DLL through a COM. The COM is invoked through a ASP. That means the DLL is to be loaded in the InetInfo.exe. LoadLibrary does not fail for dlls other than Application Extension DLLS. Please can anyone help...

LoadLibrary Explorer
My latest toy is now available for download: The LoadLibrary Explorer. This allows you to run through various scenarios for LoadLibrary. Interestingly, I have found what appear to be three errors in the documentation (or in the implementation of ::LoadLibrary). I'm disappearing for a couple weeks, so let me know if you discover any problems, and I'll address them in about a month. joe www.flounder.com/loadlibrary_explorer.htm Joseph M. Newcomer [MVP] email: newcomer@flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm -- NewsGuy.Com 30Gb $9...

Inetinfo and LoadLibrary
Hi, I have a COM. I am invoking a method in the COM from an ASP. I need to make a call to LoadLibrary in this method. For some reason it is returning NULL. Can anyone please help me out ? Regards Ganesh. Run depends.exe on your dll and see if it shows all the dependent dlls correctly. I have no idea about ASP related issues that may do this. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Ganesh Amle" <ganeshamle@assetlink.com> wrote in message news:O7Y$Q579DHA.548@TK2MSFTNGP11.phx.gbl... | Hi, | | I have a COM. I am invoking a method in the COM from an ASP. | I need t...

LoadLibrary question
Hi All, Could anyone please let me know if it is possible to load a library which has been built with a /MD compiler witch into an exe which has been build with a /ML compiler switch using 'LoadLibrary'? I am sure that it can be done, but I want to know what will be the implications of such a load? Would that be a good idea? Also, if at all I am to load a dll into an exe which has been statically linked to C runtime libraries (using /ML option), should the dll to be loaded be also statically linked to C runtime libraries or it will be OK if the dll has been dyanamically linked with C...

LoadLibrary not loading dependent libraries?
Can someone tell me if this is the case? Say I have MyDLL_A.dll that uses MyDLL_B.dll When MyExe.exe (that has no dependency on MyDLL_*.dll) calls mod = LoadLibrary("MyDLL_A"); func = GetProcAddress(mod, "foo"); func(); It should fail, shouldn't it? The reason I am asking is because I have a exe (that does not use MFC) trying to load (and then getprocaddress) a DLL that does use MFC... when calling (MFC) functions inside the DLL, it crashes, I suspect this is due to the reason I stated above... am I correct?? If that's the case, can someone tell me what is an ...

LoadLibrary Error
Hi All, I'm trying use LoadLibrary, but always fail, and I get error 998 (GetLastError();) How I fix this. HINSTANCE module = LoadLibrary("E:\\project-ucs\\_project\\system\\soa\\source-ucsms\\out-project\\debug\\wiz-addter.dll"); if(module == NULL) { // error // GetLastError(); MessageBox(err.c_str()); } Thanks Which equates to "Invalid access to memory location." Does the call fail with other DLLs too, or just wiz-addter.dll? Retf wrote: > Hi All, > I'm trying use LoadLibrary, but always fail, and I get error 998 > (GetLastError();) >...

LoadLibrary/LoadLibraryEx does not follow documentation
I've been playing with LoadLibrary/LoadLibraryEx. I've found several places where I appear to see behavior different than what is documented. I need to work on this more carefully to make sure I haven't done something wrong, but I'm leaving for a couple weeks so I thought I'd toss this set of ideas out, and I'll probably work on it some more when I return. So if you have evidence my conclusions are erroneous, it suggests an error it my test program. For example, using XP SP2, I set HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode to 1. It d...

LoadLibrary and AfxLoadLibrary
I am trying to load a DLL with AfxLoadLibrary() The call is made from an MFC extension DLL and the library it is attempting to load does not use MFC. In fact the program enumerates DLLs in its own directory, which have names fitting a certain format: they are language resource DLLs. It then tries to load each such library, and get a string from it giving the name of the language which it implements. Sometimes it succeeds, and sometimes it fails. When it fails, GetLastError(), gives me a message which just says (as I understand my Spanish-speaking friend's result!) that the co...

loadlibrary returns ERROR_NOACCESS
WINXP, VC6 sp5. i have written a dll that dynamically loads other dlls as plugins. my dll does not use MFC but one of the plugin dlls does. when i statically link against my dll in a console application everything works fine. when i dynamically link against my dll in an mfc dialog based application everything works fine. but, when i statically link against my dll in an mfc dialog based application, when i try to load the mfc plugin dll I get a ERROR_NOACCESS. any help will be greatly appreciated as i'm really stuck here. thanks, elewinso. > but, when i statically link against my d...

Default path for application and LoadLibrary
This is wide question, so maybe it is not about MFC but about windows executables at all. But anyway. In my application I have delay loaded libraries. I use several components in my application which are implemented in separated DLLs. Before running them I need to know if they are fisically exist in the application's folder. And if they dodn't simple don't use them. The problem is that my application could be run with some kind of default application path. I don't know exactly how it works, but the point is that my application fisically exist let's say in the path &q...

Problem with LoadLibrary( 'outlook.exe' ), error 1157
Hi out there, I have a strange problem with Outlook 2000 which occurs on several Win98 systems. When I start Outlook as an application, everything seems fine. But when I try to load Outlook as a library, as in LoadLibrary( '...\Outlook.exe' ) I get an error 1157 (a lib could not be found). The problem is, I cannot find out WHICH!!!! lib cannot be found. How can I force this piece of essential information out of the dumb system? (sorry) The exe itself cannot be the problem. It is there. The path is correct. Can anyone help me? Please note, the LoadLibrary call is used in a thi...

LoadLibrary fails for Windows XP SP3
Our MFC dialog based Installer application shows error loading =93newdev.dll=94 after Windows SP3 service pack is installed and also after update with IE8 and Security updates for windows. GetLastError() reveals error code 998 (ERROR_NOACCESS) As suggested in the thread from Microsoft http://support.microsoft.com/kb/q= 196069/ I tried to get the stack trace to trace the issue using =93user mode dump process and WinDbg=94. Since its windows system DLL I have limited clue to the issue. Please help. Further info 1. I tried loading the =93newdev.dll=94 from the small =93consol...

LoadLibrary Failing when it shouldn't.
I have an application in which I have an MFC (statically linked) EXE and a non-MFC DLL. Up until yesterday, I was having no problems and everything was working just fine. Now this morning, I'm getting a strange error. In my EXE I use LoadLibrary to load my non-MFC DLL and to load some other functions from kernel.dll. Loading kernel.dll works fine, no problem at all. However, the LoadLibrary calls to MY dll fail with a "The specified module could not be found" error. Mr Obvious says to check the path, which I have done over and over and over. Even if I hardcode the fully qualifi...

LoadLibrary returns NULL and error code ERROR_INVALID_ADDRESS
Hello, I am using the LoadLibrary to load a DLL I've written, but the return value is NULL and GetLastError returns ERROR_INVALID_ADDRESS. The error happens under Release build. Any ideas why this is happening? Thanks Simon Jefferies jefferies_simon@hotmail.com ...

LoadLibrary() fails in vista but works fine on XP
Hello, I'm surprised no one really encountered the exact problem that I've now. I've the VC++ code that works fine on XP but simply hangs up in Vista SP1. Here is the snippet. HINSTANCE hInst = NULL; // hInst = LoadLibrary("ThirdParty.dll"); I'm clueless. Thank you. Install third party dll on vista machine. :o) Then again maybe the third party dll is looking for a dll that is not installed on the vista machine. AliR. "KK" <pedagani@gmail.com> wrote in message news:0487c86a-57f5-480b-ad93-90a723868eab@n1g2000prb.googlegroups.com... > Hell...

LoadLibrary fails with message "Module Not Found"
Hi All , I am facing a problem with LoadLibrary wherein , when i try to load my custom dll XYZ.dll from system32 it works fine. If i place the same dll in Program Files/Custom Folder/XYZ.dll and try to load it , LoadLibrary fails with error number 0x7E meaning Moudule Not Found. I try to find out the dependencies , with Depends.exe and my custom dll XYZ.dll depends on dlls only from System32 meaning it doesn't depend on any other custom dlls. What might be the problem??? Any help is greatly appreciated... -Santosh //KRLoadLibraryFails I believe LoadLibrary looks for the DLL in the cur...

LoadLibrary() Fails (@err 998:invalid Memeory Access)
hi all , i am getting this Problem i am Unable to Load the DLL/ACM, the Problem with this (DLL /ACM ) is its a C code but this DLL using the C++ library i written a wrapper for C++ library and Used this now, its Linking Correctly....and Created the (DLL/ACM), but when i try to load this (DLL/ACM) i am getting a LoadLibrary() is failing and flagging Error 998 (invalid memory access) so please help me out its very Urgent thanks in advance. It would help a lot if you showed the code, and told us, at the point where the error occurred, what the ACTUAL parameters are. At that point, the problem w...

Help! can't use system after loadlibrary?
Hi guys, I use system() to run a exe file first, then use loadlibrary(), GetProcAddress(), FreeLibrary() to use MAPISendMail() to send Email. But after that, I can't run the exe again. are system() and loadlibrary()+GetProcAddress()+ FreeLibrary() conflict? Help me! thanks! Thank you! Elias I failed again, but I am still trying, I think I didn't release the memory after call MAPI >-----Original Message----- >No there is no conflict at all... > >Try to use WinExec() to run a program. >Make sure that the current directory is not being changed when you do >s...

LoadLibrary("jvm.dll") == NULL on Vista Ultima
Hi, The Following is working on Win9.x up to XP, but not under Vista. HINSTANCE lib = LoadLibrary(szFullAbsolutePathToJavaJVM_DLL); if(lib == NULL || lib == 0){ trace(_T("Couldn't find the jvm.dll")); return FALSE; } lib is always 0. GetLastError(); returns too always 0 If found that: http://blogs.msdn.com/junfeng/archive/2006/04/17/577260.aspx Some advice ? I use this stuff to call Java from c++, it is all working very stable to now ! best Regards, David Is Java Virtual Machine installed on that vista machine? AliR. <dawjdh@googlemail.com> wrote in me...

LoadLibrary("rsaenh.dll") exits process with code 128 (Windows 2003 Server)
Hi all, don't know if this is the correct newsgroup, sorry if it's not; at least the problem occurs in a MFC MDI application. I tracked the problem down to the following: In a (huge) MFC MDI app I do LoadLibrary("rsaenh.dll") somewhere (doesn't matter where) in MyApp::InitInstance(). This works on WinXP, but on Win2003 Server SE I have the following effects: 1. When using the call within the target application (huge MFC MDI application with ComServer etc., but started as normal EXE) and the rsaenh.dll shipped with Win2003 Server (version 5.2.3790.1830 (srv03_sp1_rtm...