The sequence for searching dll files in windows is as follows:(1) memory (2) knowndlls (3) List and. local (4) application directory (5) current working directory (6) system directory (7) PATH variable
I don't know much about it. Check the information to confirm it.
Check msdn as follows: http://msdn.microsoft.com/zh-cn/library/7d83bc18.aspx
By using implicit and explicit links, Windows first searches for "known DLL", such as Kernel32.dll and User32.dll. Windows then searches for DLL in the following order:
Implicit LinkIt is sometimes called a dynamic link during static loading or loading. Explicit links are sometimes called dynamic links during loading or running.
Under the implicit link, use the DLL executable file to link to the import library (. lib file) provided by the DLL creator ). When the DLL executable file is used for loading, the operating system loads the DLL. The client executable file calls the DLL export function, as if these functions are included in the executable file.
InExplicit link. The client executable file must use the function pointer to call the export function.
"Known DLL(Informal name) refers to the list of DLL (Dynamic Link Library) specially processed by the module loader of the kernel. When the loader finds a program with a dynamic link to a known DLL during loading, it immediately uses a known copy, ignoring the search algorithm normally applied to the module loading.
TheMemoryWhy? Search for a dynamic library is memory first. If the memory exists, it does not need to be loaded; otherwise, it needs to be searched and loaded into the memory. The main advantage of dll is to save memory and reduce swap operations. Many processes can use a DLL at the same time and share a copy of the DLL in the memory. On the contrary, for each application generated using a static Link Library, Windows must load a copy of the library code in the memory.
It seems that the local file is like a configuration, and no relevant information is found. It is not clear.
Current Working Directory ),Generally, each process has a directory associated with the hierarchical file system, which is called the current working directory of the process. If the program enters the main entrance, the current working directory is actually the directory where the program starts, however, the current working directory can be set through a program or changed with the directories determined by objects such as OpenFileDialog and SaveFileDialog.
The directory where the application is located,The directory from which the process starts, that is, the directory where the program file is located. It is different from the current working directory.