// // HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs // { this can change the searches:
1) If a DLL with the same module name is already loaded in memory, the system will only check the redirection and a manifest before resolving to the loaded DLL, ... regardless of which directory it is in. The system does not search the DLL.
2) If the DLL is in the list of known DLLs for the version of Windows the application is running on, the system will use its copy of the known DLL ... (and the DLLs dependent on the known DLL, if any) instead of looking up the DLL. For a list of known DLLs on the current system, ... see the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs.
3) If a DLL has dependencies, the system will look for the dependent DLLs as if they were loaded with just their module names. ... This is true even if the first DLL was loaded specifying a full path.
I tested: SetDllDirectory can only be used for dynamically called Dll functions. For statically declared Dll functions, SetDllDirectory has no effect. Even if you add a unit, put it in the first place of the project, and call SetDllDirectory in initialization, it will not work.
----------------------------------------------
武汉天气不好
The directory to be added to the search path. If this parameter is an empty string (""), the call removes the current directory from the default DLL search order. If this parameter is NULL, the function restores the default search order.
The SetDllDirectory function affects all subsequent calls to the LoadLibrary and LoadLibraryEx functions.
It also effectively disables safe DLL search mode while the specified directory is in the search path.
For Win32 processes that are not running a packaged or protected process, calling this function will also affect the DLL search order of the children processes started from the process that has called the function.
//----------//
if need more paths, you can use "AddDllDirector(...)"
An absolute path to the directory to add to the search path. For example, to add the directory Dir2 to the process DLL search path, specify \Dir2. For more information about paths, see Naming Files, Paths, and Namespaces.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
unfortunatelly, if you define the DLL call on exe-main (statically), SetDllDirectory can not changes this path!!!
basically, because the "DLL" reside in the same space than Exe! understandood like a "Child"- from "Exe"
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3