Ư¼ö Æú´õÀÇ À§Ä¡°¡ ¸¶À̱׷¹ÀÌ¼Ç DLL ±¸ÇÏ´Â ¹æ¹ý

±â¼ú ÀÚ·á: 241733 - ÀÌ ¹®¼­°¡ Àû¿ëµÇ´Â Á¦Ç° º¸±â.
¸ðµÎ È®´ë | ¸ðµÎ Ãà¼Ò

¿ä¾à

¾÷±×·¹À̵åÇÏ´Â µ¿¾È Windows 95 ¶Ç´Â Windows 98¿¡¼­ Windows 2000 Professional, ½ÃÀÛ ¸Þ´º Æú´õ °°Àº Ư¼ö Æú´õ¸¦ ¾×¼¼½º ¶Ç´Â µ¥½ºÅ©Åé Æú´õ ¸¶À̱׷¹ÀÌ¼Ç DLL ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¸¶À̱׷¹ÀÌ¼Ç DLLÀº ÀÌ·¯ÇÑ ±âº» À§Ä¡¿¡ Æú´õ°¡ ÀÖ´Â °¡Á¤ÇÒ ¼ö ¾ø½À´Ï´Ù. ´ë½Å, SHGetSpecialFolderPath ¶Ç´Â SHGetFolderPath »ç¿ëÇØ¾ß ÇÕ´Ï´Ù.

Ãß°¡ Á¤º¸

Internet Explorer 4.0 ¹ÙÅÁ È­¸é ¾÷µ¥ÀÌÆ®·Î ¼³Ä¡ÇÑ °æ¿ì¿¡¸¸ SHGetSpecialFolderPath Windows 95¿¡¼­ ÀÛµ¿ÇÕ´Ï´Ù. Windows 2000¿¡¼­ SHGetSpecialFolderPath Ç×»ó »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ±×·¯³ª µÎ °æ¿ì ¸ðµÎ SHGetSpecialFolderPathÀÇ SupersetÀÓ »õ SHGetFolderPath API¸¦ »ç¿ëÇÏ´Â °ÍÀÌ °¡Àå ÁÁ½À´Ï´Ù. Windows 95 ¶Ç´Â Windows 98 SHGetFolderPath »ç¿ëÇÏ·Á¸é ¸¶À̱׷¹ÀÌ¼Ç DLLÀº ÇÔ²² SHFolder.dll ÆÄÀÏÀ» Àç¹èÆ÷ÇØ¾ß ÇÕ´Ï´Ù.

SHFolder.dll ÃֽŠPlatform SDK¿¡¼­ ¾òÀ» ¼ö ÀÖ½À´Ï´Ù. Platform SDK¸¦ ´Ù¿î·ÎµåÇÏ·Á¸é ´ÙÀ½ À¥ »çÀÌÆ®¸¦ ÂüÁ¶ÇϽʽÿÀ.
http://www.microsoft.com/msdownload/platformsdk/setuplauncher.htm
Platform SDK¸¦ ¼³Ä¡ÇÒ ¶§ Àç¹èÆ÷ °¡´É ±¸¼º ¿ä¼Ò ¹× ºôµå ȯ°æ¿¡ ¼³Ä¡ÇÒ ¼ö ÀÖ´ÂÁö È®ÀÎÇϽʽÿÀ. ¶ÇÇÑ Microsoft Visual ¹¯´Â ¸Þ½ÃÁö°¡ ³ªÅ¸³ª¸é C++¸¦ »ç¿ëÇÏ¿© Ç÷§Æû SDK ÅëÇÕÇÏ·Á¸é ¼±ÅÃÇϽʽÿÀ. ÇÊ¿äÇÑ SHFolder.h ÆÄÀÏÀ» ¶§¹®¿¡ ÇÊ¿äÇÕ´Ï´Ù. Platform SDK ¼³Ä¡µÇ¸é ¼³Ä¡ Æú´õ¿¡ ´ëÇÑ Àç¹èÆ÷ °¡´É ½ÇÇà SHFolder.exe °Ë»öÇϽʽÿÀ. ÀÌ ÆÄÀÏ SHFolder.dll ¹× Windows 95 ¶Ç´Â Windows 98 ½ÇÇàÇϱâ À§ÇØ ÇÊ¿äÇÑ ¾÷µ¥ÀÌÆ®¸¦ ¸ðµÎ ¼³Ä¡ÇÕ´Ï´Ù. »ç¿ëÀÚ°¡ ÄÄÇ»ÅÍ¿¡¼­ ¸¶À̱׷¹ÀÌ¼Ç DLLÀ» ³Ö½À´Ï´Ù ¶§ ÀÌ ½ÇÇà ÆÄÀÏÀº »ç¿ëÀÚÀÇ ÄÄÇ»ÅÍ¿¡¼­ ½ÇÇàÇØ¾ß ÇÕ´Ï´Ù. ÀÌ´Â ¶ÇÇÑ ÀÀ¿ë ÇÁ·Î±×·¥ ¼³Ä¡ Áß¿¡ ¼³Ä¡ÇÒ ¼ö ÀÖ½À´Ï´Ù.

SHGetFolderPath API¿¡ ´ëÇÑ Æ÷ÀÎÅ͸¦ °¡Á®¿À´Â ¹æ¹ýÀ» º¸¿© ÁÖ´Â ÄÚµåÀÔ´Ï´Ù:
#include <windows.h>
#include <shfolder.h>

PFNSHGETFOLDERPATHA GetFuncPtr_SHGetFolderPathA()
{
   static HMODULE hMod = NULL;
   PFNSHGETFOLDERPATHA pSHGetFolderPath = NULL;

   // Load SHFolder.dll only once
   if (!hMod)
      hMod = LoadLibrary("SHFolder.dll");

   if (hMod)
      // Obtain a pointer to the SHGetFolderPathA function
      pSHGetFolderPath = (PFNSHGETFOLDERPATHA)GetProcAddress(hMod, 
         "SHGetFolderPathA");

   return pSHGetFolderPath;
}
				

´ÙÀ½ ÄÚµå ¿¹Á¦´Â ÇϳªÀÇ °¡´ÉÇÑ ÀÌ ÇÔ¼ö¸¦ »ç¿ëÇÏ´Â ¹æ¹ýÀ» º¸¿© ÁÝ´Ï´Ù. Windows 2000À¸·Î ¾÷±×·¹À̵åÇÏ´Â µ¿¾È Windows 2000 ƯÁ¤ ÇÁ·Î±×·¥ ¶Ç´Â ÀÀ¿ë ÇÁ·Î±×·¥ÀÇ ½ÃÀÛ ¸Þ´º ÇÁ·Î±×·¥ Æú´õÀÇ ¹Ù·Î °¡±â°¡ ÇÊ¿äÇÑ À¯Æ¿¸®Æ¼ ÀÀ¿ë ÇÁ·Î±×·¥À» Æ÷ÇÔÇÒ ¼ö ÀÖ½À´Ï´Ù. »õ ÇÁ·Î±×·¥ÀÌ ÄÄÇ»ÅÍ¿¡ º¹»çÇÑ ÈÄ ¸¶À̱׷¹ÀÌ¼Ç DLLÀº »ç¿ëÀÚÀÇ ½ÃÀÛ ¸Þ´º¿¡ ¹Ù·Î °¡±â¸¦ Ãß°¡ÇÒ ¼ö ÀÖ½À´Ï´Ù. »ç¿ëÀÚº° ¼³Á¤À» MigrateUserNT ÇÔ¼ö¸¦ ÀÌ ÀÛ¾÷À» ¼öÇàÇÏ´Â °¡Àå ÁÁÀº ÀÚ¸®ÀÔ´Ï´Ù.

´ÙÀ½ ÇÔ¼ö´Â ¼¼ °³ÀÇ ¸Å°³ º¯¼ö¸¦ »ç¿ëÇÕ´Ï´Ù. ù ¹øÂ° ¸Å°³ º¯¼ö´Â ½ÇÇà ´ë»ó °æ·ÎÀÔ´Ï´Ù. µÎ ¹øÂ° ¸Å°³ º¯¼ö¿¡ ´ëÇÑ ¼³¸íÀÔ´Ï´Ù. ¸¶Áö¸· ¸Å°³ º¯¼ö´Â ½ÃÀÛ ¸Þ´º ÇÁ·Î±×·¥ Æú´õ¿¡¼­ ¸¸µç ÇÏÀ§ Æú´õÀÔ´Ï´Ù. ÀÌ ¹Ù·Î °¡±â¸¦ ¸¸µé ¼ö ÀÖ½À´Ï´Ù.
#include <windows.h>
#include <objbase.h>
#include <shlobj.h>
#include <shfolder.h>

HRESULT CreateUserStartMenuShortcut(LPSTR pszShortcutFile,
            LPSTR pszDescription, LPTSTR pszRelativeFolder)
{
   HRESULT hr;
   PFNSHGETFOLDERPATHA pSHGetFolderPath = NULL;
   TCHAR pszLink[MAX_PATH];
   BOOL bFound = FALSE;

   pSHGetFolderPath = GetFuncPtr_SHGetFolderPathA();

   // Find the current user's Start Menu Programs folder
   if (pSHGetFolderPath)
      bFound = SUCCEEDED(pSHGetFolderPath(NULL, CSIDL_PROGRAMS, 
                           NULL, SHGFP_TYPE_CURRENT, pszLink));

   if (bFound)
   {
      // Proceed to create the shortcut
      IShellLink *pIShellLink = NULL;
      IPersistFile *ppf = NULL;
      WCHAR pLinkUnicode[MAX_PATH];

      CoInitialize(NULL);

      // Get a pointer to the IShellLink interface.
      hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
                            IID_IShellLink, (void **)&pIShellLink);

      if (SUCCEEDED(hr))
      {
         // Get a pointer to IPersistFile interface for saving shortcut
         hr = pIShellLink->QueryInterface(IID_IPersistFile, (void **)&ppf);

         if (SUCCEEDED(hr))
         {   
            hr = pIShellLink->SetPath(pszShortcutFile);
            hr = pIShellLink->SetDescription(pszDescription);

            if (SUCCEEDED(hr))
            {
               // Add the target folder to the Start Menu Programs path
               lstrcat(pszLink, "\\");
               lstrcat(pszLink, pszRelativeFolder);
               lstrcat(pszLink, "\\");

               // Create the directory if it does not exist
               CreateDirectory(pszLink,NULL);

               // Add the file name for the shortcut
               lstrcat(pszLink, pszDescription);
               lstrcat(pszLink, ".lnk");

               // Convert string to Unicode, and call IPersistFile::Save()
               MultiByteToWideChar(CP_ACP, 0, pszLink, -1, pLinkUnicode, MAX_PATH);
               hr = ppf->Save(pLinkUnicode, TRUE);
            }
            ppf->Release();
         }
         pIShellLink->Release();
      }
      CoUninitialize();
   }

   return hr;
}
				
SHGetSpecialFolderPath ¹× SHGetFolderPath ÀÌ·¯ÇÑ ±â´ÉÀ» ¾òÀ» ¼ö Àִ Ư¼ö Æú´õ ´Ù¸¥ À¯ÇüÀÇ È®ÀÎÇÏ·Á¸é ¼³¸í¼­¸¦ ÂüÁ¶ÇϽʽÿÀ. CoInitialize ¹× CoUnitializeÀÌ ÀÌ ÇÔ¼ö¸¦ È£ÃâÇÑ ¿¹Á¦¿¡¼­´Â À¯ÀÇÇϽʽÿÀ. ÀÌ·¯ÇÑ È£ÃâÀº COM ´Ù¸¥ ÇÔ¼ö¸¦ »ç¿ëÇÏ´Â °æ¿ì ¸¶À̱׷¹ÀÌ¼Ç DLL DllMain ÇÔ¼ö´Â ¿Å°Ü¾ß ÇÕ´Ï´Ù. CoInitialize DLL_PROCESS_DETACH ¾Ë¸²¿¡ ´ëÇØ DLL_PROCESS_ATTACH ¾Ë¸² ¹× CoUninitialize È£Ãâ.

ÂüÁ¶

¸¶À̱׷¹ÀÌ¼Ç DLL¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ ³»¿ëÀº MSDN Library¿¡¼­ ´ÙÀ½ Ç׸ñÀ» ÂüÁ¶ÇϽʽÿÀ.
Ç÷§Æû SDK °ü¸® ¼­ºñ½º; ¼³Ä¡; ¸¶À̱׷¹ÀÌ¼Ç È®Àå ÀÎÅÍÆäÀ̽º

¼Ó¼º

±â¼ú ÀÚ·á: 241733 - ¸¶Áö¸· °ËÅä: 2007³â 3¿ù 1ÀÏ ¸ñ¿äÀÏ - ¼öÁ¤: 3.4
º» ¹®¼­ÀÇ Á¤º¸´Â ´ÙÀ½ÀÇ Á¦Ç°¿¡ Àû¿ëµË´Ï´Ù.
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 98 Standard Edition
  • Microsoft Windows 95
Ű¿öµå:?
kbmt kbfaq kbhowto kbmigrate kbsetup KB241733 KbMtko
±â°è ¹ø¿ªµÈ ¹®¼­
Áß¿ä: º» ¹®¼­´Â Àü¹® ¹ø¿ª°¡°¡ ¹ø¿ªÇÑ °ÍÀÌ ¾Æ´Ï¶ó Microsoft ±â°è ¹ø¿ª ¼ÒÇÁÆ®¿þ¾î·Î ¹ø¿ªÇÑ °ÍÀÔ´Ï´Ù. Microsoft´Â ¹ø¿ª°¡°¡ ¹ø¿ªÇÑ ¹®¼­ ¹× ±â°è ¹ø¿ªµÈ ¹®¼­¸¦ ¸ðµÎ Á¦°øÇϹǷΠMicrosoft ±â¼ú ÀÚ·á¿¡ ÀÖ´Â ¸ðµç ¹®¼­¸¦ Çѱ۷ΠÁ¢ÇÒ ¼ö ÀÖ½À´Ï´Ù. ±×·¯³ª ±â°è ¹ø¿ª ¹®¼­°¡ Ç×»ó ¿Ïº®ÇÑ °ÍÀº ¾Æ´Õ´Ï´Ù. µû¶ó¼­ ±â°è ¹ø¿ª ¹®¼­¿¡´Â ¸¶Ä¡ ¿Ü±¹ÀÎÀÌ Çѱ¹¾î·Î ¸»ÇÒ ¶§ ½Ç¼ö¸¦ ÇÏ´Â °Íó·³ ¾îÈÖ, ±¸¹® ¶Ç´Â ¹®¹ý¿¡ ¿À·ù°¡ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù. Microsoft´Â ³»¿ë»óÀÇ ¿À¿ª ¶Ç´Â Microsoft °í°´ÀÌ ÀÌ·¯ÇÑ ¿À¿ªÀ» »ç¿ëÇÔÀ¸·Î½á ¹ß»ýÇÏ´Â ºÎ Á¤È®¼º, ¿À·ù ¶Ç´Â ¼ÕÇØ¿¡ ´ëÇØ Ã¥ÀÓÀ» ÁöÁö ¾Ê½À´Ï´Ù. Microsoft´Â ÀÌ·¯ÇÑ ¹®Á¦¸¦ ÇØ°áÇϱâ À§ÇØ ±â°è ¹ø¿ª ¼ÒÇÁÆ®¿þ¾î¸¦ ÀÚÁÖ ¾÷µ¥ÀÌÆ®Çϰí ÀÖ½À´Ï´Ù.

Çǵå¹é º¸³»±â