Adds a directory to the process DLL search path.
DLL_DIRECTORY_COOKIE WINAPI AddDllDirectory( |
Parameters
- NewDirectory [in]
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.
Return value
If the function succeeds, the return value is an opaque pointer that can be passed to RemoveDllDirectory to remove the DLL from the process DLL search path.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The AddDllDirectory function can be used to add any absolute path to the set of directories that are searched for a DLL. If SetDefaultDllDirectories is first called with LOAD_LIBRARY_SEARCH_USER_DIRS, directories specified with AddDllDirectory are added to the process DLL search path. Otherwise, directories specified with the AddDllDirectory function are used only for LoadLibraryEx function calls that specify LOAD_LIBRARY_SEARCH_USER_DIRS.
If AddDllDirectory is used to add more than one directory to the process DLL search path, the order in which those directories are searched is unspecified.
To remove a directory added with AddDllDirectory, use the RemoveDllDirectory function.
Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008: To use this function in an application, call GetProcAddress to retrieve the function's address from Kernel32.dll. KB2533623 must be installed on the target platform.
Requirements
Minimum supported client | Windows 8 [desktop apps only] |
---|---|
Minimum supported server | Windows Server 2012 [desktop apps only] |
Version | KB2533623 on Windows 7, Windows Server 2008 R2, Windows Vista, and Windows Server 2008 |
Header |
|
DLL |
|
from : https://msdn.microsoft.com/en-us/library/hh310513(v=vs.85).aspx
///1256.
'VisualStudio.C++.C# > 코딩팁,함수활용,단편' 카테고리의 다른 글
error LNK2001: unresolved external symbol __imp_sprintf, symbol __imp_printf 해결방법. (0) | 2017.03.19 |
---|---|
Delay Loading DLL (0) | 2017.03.17 |
SetDllDirectory (0) | 2017.03.17 |
dll 파일로 lib 만들기. def 파일 만들고 그 다음 lib 파일 생성. (1) | 2017.03.13 |
MFC. png 이미지 파일 읽기. (0) | 2017.02.21 |
댓글