• <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++博客 首頁 新隨筆 聯(lián)系 聚合 管理
              217 Posts :: 61 Stories :: 32 Comments :: 0 Trackbacks

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

               

             

            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) 評(píng)論(0)  編輯 收藏 引用

            只有注冊用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            热99RE久久精品这里都是精品免费| 久久精品国产99久久久古代| 精品久久久久久综合日本| 久久综合九色综合久99| 国产叼嘿久久精品久久| 区久久AAA片69亚洲| 亚洲国产精品久久久久| 亚洲AⅤ优女AV综合久久久| 蜜臀久久99精品久久久久久小说| 国产2021久久精品| 久久综合给合久久国产免费 | 久久精品国产一区二区电影| 久久午夜夜伦鲁鲁片免费无码影视| 久久婷婷国产综合精品| 久久丝袜精品中文字幕| 精品久久久久久国产| 久久综合亚洲色HEZYO社区| 精品久久久久久国产免费了| 久久精品午夜一区二区福利| 亚洲精品tv久久久久| 久久久久综合网久久| 色欲综合久久中文字幕网| 久久精品综合一区二区三区| 狠狠色丁香婷婷综合久久来| 蜜臀av性久久久久蜜臀aⅴ麻豆 | 国产精品久久久久a影院| 精品国产福利久久久| 国内精品久久久久久99| 97久久国产露脸精品国产| 亚洲欧洲中文日韩久久AV乱码| 亚洲国产成人久久精品影视| 国产亚洲欧美精品久久久| 久久精品人人做人人妻人人玩| 亚洲欧洲中文日韩久久AV乱码| 久久久精品视频免费观看 | 久久久久四虎国产精品| 91精品国产色综合久久| 精品午夜久久福利大片| 51久久夜色精品国产| 色综合久久久久网| 岛国搬运www久久|