c/c++实现将cef的一堆dll单独放在一个文件夹,与程序exe目录区分开
2017-12-13 22:58
1196 查看
Adds a directory to the search path used to locate DLLs for the application.
BOOL WINAPI SetDllDirectory(
__in LPCTSTR lpPathName
);
Parameters
lpPathName
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.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
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.
After calling SetDllDirectory, the DLL search path is:
The directory from which the application loaded.
The directory specified by the lpPathName parameter.
The system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is System32.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.
To revert to the default search path used by LoadLibrary and LoadLibraryEx, call SetDllDirectory with NULL. This also restores safe DLL search mode based on the SafeDllSearchMode registry value.
To compile an application that uses this function, define _WIN32_WINNT as 0x0502 or later. For more information, see Using the Windows Headers.
Requirements
Client
Requires Windows Vista or Windows XP SP1.
Server
Requires Windows Server 2008 or Windows Server 2003.
Header
Declared in Winbase.h; include Windows.h.
Library
Use Kernel32.lib.
DLL
Requires Kernel32.dll.
Unicode
Implemented as SetDllDirectoryW (Unicode) and SetDllDirectoryA (ANSI).
See Also
Dynamic-Link Library Search Order
GetDllDirectory
GetSystemDirectory
GetWindowsDirectory
LoadLibrary
LoadLibraryEx
Send comments about this topic to Microsoft
BOOL WINAPI SetDllDirectory(
__in LPCTSTR lpPathName
);
Parameters
lpPathName
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.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
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.
After calling SetDllDirectory, the DLL search path is:
The directory from which the application loaded.
The directory specified by the lpPathName parameter.
The system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is System32.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.
To revert to the default search path used by LoadLibrary and LoadLibraryEx, call SetDllDirectory with NULL. This also restores safe DLL search mode based on the SafeDllSearchMode registry value.
To compile an application that uses this function, define _WIN32_WINNT as 0x0502 or later. For more information, see Using the Windows Headers.
Requirements
Client
Requires Windows Vista or Windows XP SP1.
Server
Requires Windows Server 2008 or Windows Server 2003.
Header
Declared in Winbase.h; include Windows.h.
Library
Use Kernel32.lib.
DLL
Requires Kernel32.dll.
Unicode
Implemented as SetDllDirectoryW (Unicode) and SetDllDirectoryA (ANSI).
See Also
Dynamic-Link Library Search Order
GetDllDirectory
GetSystemDirectory
GetWindowsDirectory
LoadLibrary
LoadLibraryEx
Send comments about this topic to Microsoft
相关文章推荐
- Qt官方开发环境生成的exe发布方式--使用windeployqt(windeployqt是单独的程序,放在低版本qt4目录下也可以运行的)
- 可以把一堆dll文件放到程序目录下的一个自建目录里面
- c#程序不必把dll放在exe目录下--app.config文件中添加dll程序集的查找目录
- 在VS2015下依赖dll或者其它库的窗体程序打包成一个单独exe程序的过程
- 一个从EXE、DLL文件中提取、存取图标完整程序
- 采用C++的ACE库实现的一个通用的C/S架构通信程序(最终版)
- ICSharpCode.SharpZipLib.dll实现压缩解压一个树形目录
- 从易到难编写C++程序,(4)问题:实现一个大整数表示的BigInt类
- 一个从EXE、DLL文件中提取、存取图标完整程序
- 一个猴子选大王问题程序(c++实现)
- Windows CE创建一个可以实现程序自启动的文件夹
- 同一目录两程序引用同一个类库dll,所引发的问题
- C++实现的一个简单的多线程程序
- iis中添加虚拟目录,作用在于可以把文件并不放在一个文件夹内,最大的好处是可以用别的服务器上的文件
- junction.exe 多程序共用一个目录数据或转移目录地址的命令junction.exe junction 教程
- ICSharpCode.SharpZipLib.dll实现压缩解压一个树形目录
- 采用C++的ACE库实现的一个通用的C/S架构通信程序
- C++.net做的卸载程序删除不了安装目录下的文件夹!!====救命啊!
- 利用IO的知识,实现一个程序列出某个目录下的所有的”.java”文件。
- 【转】 一个从EXE、DLL文件中提取、存取图标完整程序