Error in loading DLL in Windows XP and WIndows 2003 Server
-
Hello All I am trying to load a DLL dynamically using LoadLibrary (). It works fine with Windows 2000 Professional. But when i am trying to load it in XP or 2003 Server I get error "The specified module could not be found" Error. DLL is present in the path where EXE is present. (C:\Program Files\Test Application\MyDll.dll"). When loading the DLL i am specifing full path as parameter. I placed the DLL path to C:\ and in System32 directory and changed the path still I get the error. DLL is basic C DLL. Unfortunately I did not get lib file along with DLL so i have load that DLL dynamically only. For MSDN i found that Windows Server 2003, Windows XP SP1: The default value of HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode is 1 (current directory is searched after the system and Windows directories). But after searching Windows Directory it has to come to current directory to find DLL. But it fails :doh: Please tell me any idea why this strange behaviour with Windows XP and 2003 Server!!!!. Thanks for your Time Ravi
-
Hello All I am trying to load a DLL dynamically using LoadLibrary (). It works fine with Windows 2000 Professional. But when i am trying to load it in XP or 2003 Server I get error "The specified module could not be found" Error. DLL is present in the path where EXE is present. (C:\Program Files\Test Application\MyDll.dll"). When loading the DLL i am specifing full path as parameter. I placed the DLL path to C:\ and in System32 directory and changed the path still I get the error. DLL is basic C DLL. Unfortunately I did not get lib file along with DLL so i have load that DLL dynamically only. For MSDN i found that Windows Server 2003, Windows XP SP1: The default value of HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode is 1 (current directory is searched after the system and Windows directories). But after searching Windows Directory it has to come to current directory to find DLL. But it fails :doh: Please tell me any idea why this strange behaviour with Windows XP and 2003 Server!!!!. Thanks for your Time Ravi
There are probably other DLLs which this DLL depends on, which you also need to redistribute. Use the depends[^] tool to discover what they are.
Stability. What an interesting concept. -- Chris Maunder