• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Error

            C++博客 首頁 新隨筆 聯系 聚合 管理
              217 Posts :: 61 Stories :: 32 Comments :: 0 Trackbacks

                今天很偶然的在cppblog上看了個博客,提到這個API,然后我想起來之前很困惑的一個問題。為什么別人的程序.exe和.dll是放在不同目錄的,而我的不能。起初我想的是也許只能用添加path這一招了。今天偶然看到這個函數順便msdn一下發現還是挺有用的。以后俺們的dll和exe也不用惡心的都丟到一起了,可以根據模塊和功能放到不同的目錄了。

               

             

            SetDllDirectory function

            9 out of 18 rated this helpful - Rate this topic

            Applies to: desktop apps only

            Adds a directory to the search path used to locate DLLs for the application.

            Syntax

            C++

            BOOL WINAPI SetDllDirectory(
              __in_opt  LPCTSTR lpPathName
            );
            
            
            Parameters
            lpPathName [in, optional]

            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 standard DLL search path is:

            1. The directory from which the application loaded.
            2. The directory specified by the lpPathName parameter.
            3. The system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is System32.
            4. 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.
            5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
            6. The directories that are listed in the PATH environment variable.

            Each time the SetDllDirectory function is called, it replaces the directory specified in the previous SetDllDirectory call. To specify more than one directory, use theAddDllDirectory function and call LoadLibraryEx with LOAD_LIBRARY_SEARCH_USER_DIRS.

            To revert to the standard search path used by LoadLibrary and LoadLibraryEx, call SetDllDirectory with NULL. This also restores safe DLL search mode based on theSafeDllSearchMode 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.

            posted on 2012-06-27 22:58 Enic 閱讀(335) 評論(0)  編輯 收藏 引用
            久久精品国产秦先生| 久久精品国产免费一区| 伊人久久综合成人网| A级毛片无码久久精品免费| 久久青青草原亚洲av无码app | 久久天天躁狠狠躁夜夜2020一 | 韩国三级大全久久网站| 国产午夜精品久久久久九九电影| 久久综合五月丁香久久激情| 亚洲国产精品无码久久一线 | 欧美一区二区久久精品| 久久久亚洲欧洲日产国码二区 | 91久久婷婷国产综合精品青草| 久久亚洲国产午夜精品理论片| 噜噜噜色噜噜噜久久| 久久久综合九色合综国产| 国产69精品久久久久9999APGF| 亚洲国产精品久久66| 国产精品99精品久久免费| 热久久视久久精品18| 久久久久亚洲?V成人无码| 久久精品亚洲一区二区三区浴池| 亚洲国产成人精品久久久国产成人一区二区三区综 | 久久久久久免费视频| 久久无码人妻精品一区二区三区| 久久精品国产网红主播| 亚洲AV无码1区2区久久| 久久精品国产亚洲AV蜜臀色欲| 久久久久国产成人精品亚洲午夜| 久久久国产精品福利免费| 久久精品人人做人人爽电影蜜月| 久久精品国产色蜜蜜麻豆| 婷婷国产天堂久久综合五月| 久久亚洲2019中文字幕| 久久免费99精品国产自在现线| 国产激情久久久久影院小草| 精品国产91久久久久久久a| 国产巨作麻豆欧美亚洲综合久久| 久久久国产精品福利免费| 99久久夜色精品国产网站| 国产精品午夜久久|