[ctypes-users] LibraryLoader loads wrong DLL
Brought to you by:
theller
From: Thor A. T. <th...@gm...> - 2012-03-14 08:31:28
|
Hi I have a DLL, lets call it interface.dll, which wraps a C++ API. This C++ API depends on another API located in console.dll. This console.dll is shipped with the C++ API and is specific to this API, i.e. the people who has made the API also made the console.dll. Both the console.dll and the C++ API DLL is located in the same folder as my interface.dll. But when using ctypes.cdll.LoadLibrary("interface.dll") the loading fails. The error reported is that a ceratin function cannot be found in the console.dll. Using DependencyWalker to profile the loading of the interface.dll I discovered that the LoadLibrary folder tries to load console.dll found in C:\Windows\system32 instead of the console.dll found in the same folder as interface.dll. Is this the wanted behaviour? Is there a way I can "help" the LibraryLoader to find the right DLL? Thanks, Thor Andreas |