c/c++能不能实现将cef的一堆dll单独放在一个文件夹,与程序exe目录区分开

正经的董同学 2017-12-12 09:50:21
c/c++能不能实现将cef的一堆dll单独放在一个文件夹,与程序exe目录区分开
...全文
271 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
正经的董同学 2017-12-13
  • 打赏
  • 举报
回复
引用 1 楼 zhao4zhong1 的回复:
SetDllDirectory Function 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 Build date: 8/15/2007
可以了,谢谢
Dobzhansky 2017-12-12
  • 打赏
  • 举报
回复
楼上说的很详细了
赵4老师 2017-12-12
  • 打赏
  • 举报
回复
SetDllDirectory Function 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 Build date: 8/15/2007

64,682

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧