• <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 閱讀(337) 評論(0)  編輯 收藏 引用
            精品国产日韩久久亚洲| 色偷偷久久一区二区三区| 亚洲国产精品热久久| 青青草原综合久久大伊人精品| 久久99精品久久久久久久不卡 | 国产精品久久影院| 伊人久久免费视频| 精品国产乱码久久久久软件| 中文国产成人精品久久不卡 | 国产精品禁18久久久夂久| 久久成人影院精品777| 精品免费久久久久国产一区| 人妻精品久久久久中文字幕| 精品综合久久久久久98| 久久中文字幕一区二区| 精品久久人人爽天天玩人人妻| 青草影院天堂男人久久| 狠狠色噜噜色狠狠狠综合久久 | 国产成人精品久久二区二区| 女同久久| 嫩草影院久久国产精品| 久久精品国产亚洲AV香蕉| 国产午夜精品久久久久九九电影| 久久久久亚洲精品日久生情 | 国产麻豆精品久久一二三| 久久综合九色综合欧美就去吻| 久久九九精品99国产精品| 香蕉久久久久久狠狠色| 夜夜亚洲天天久久| 国产成人久久精品激情| 伊人色综合久久天天人守人婷| 麻豆精品久久精品色综合| 婷婷伊人久久大香线蕉AV| 久久久久久伊人高潮影院| 精品国产青草久久久久福利| 久久ZYZ资源站无码中文动漫| 国产激情久久久久久熟女老人| 欧美成a人片免费看久久| 久久久久国产视频电影| 久久亚洲高清观看| 国产日产久久高清欧美一区|