????? ????? ???? ?????? ?????? ??? ??? Mapisvc.inf ?? Microsoft Outlook

?????? ????????? ?????? ?????????
???? ???????: 229700 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

?????? FGetComponentPath ?? ????? Mapistub.dll ?????? ?????? ??? ?????? ??? ????? Mapisvc.inf ???? Microsoft Outlook. ??? ??? ??????? ????? ?????? ??? ?????? ??? ????? Mapisvc.Inf ???????? ????? ????????? ???????? ?? ???? " ???? ?? ????????? ".

????? ??? Microsoft Outlook 2000? ?? ????? ??? Mapisvc.inf ??? ???? ??? ??????? ?????? ?????? Win32 API GetSystemDirectory ??? ???? ??????,.

??????? ????

?????? ????? ????????? ???????? ?????? ????? ????? ?????? ?? ???? ????????? ??????? ?? Outlook. ????? ????????? ???????? ?????? ?? ?????? ??? ????? Mapisvc.inf ???? Mapisvc.inf ????? ????? ??? ?????? ?????? ?? ??.
typedef BOOL (STDAPICALLTYPE FGETCOMPONENTPATH)
(LPSTR szComponent,
 LPSTR szQualifier,
 LPSTR szDllPath,
 DWORD cchBufferSize,
 BOOL fInstall);
typedef FGETCOMPONENTPATH FAR * LPFGETCOMPONENTPATH;    

/////////////////////////////////////////////////////////////////////////////// 
// Function name    : InitMAPIDir
// Description      : For Outlook 2000 compliance. This will get the correct path to the
//                  : MAPISVC.INF file.
// Return type      : void 
// Argument         : LPSTR szMAPIDir - Buffer to hold the path to the MAPISVC file.
//                  : ULONG cchINIFileName - size of szMAPIDir
void InitMAPIDir(LPSTR szINIFileName, ULONG cchINIFileName)
{
    UINT uiRet = 0;
    CHAR szSystemDir[MAX_PATH+1] = {0};

    // Get the system directory path
    // (mapistub.dll and mapi32.dll reside here)
    uiRet = GetSystemDirectoryA(szSystemDir, MAX_PATH);
    if(uiRet > 0)
    {
        HRESULT hRes = S_OK;
        CHAR szDLLPath[MAX_PATH+1] = {0};

        hRes = StringCchPrintfA(szDLLPath, MAX_PATH+1, "%s\\%s", 
            szSystemDir, "mapistub.dll");
        if(SUCCEEDED(hRes))
        {
            LPFGETCOMPONENTPATH pfnFGetComponentPath = NULL;

            HMODULE hmodStub = 0;
            HMODULE hmodMapi32 = 0;

            // Load mapistub.dll
            hmodStub = LoadLibraryA(szDLLPath);
            if(hmodStub)
            {   
                // Get the address of FGetComponentPath from the mapistub
                pfnFGetComponentPath = (LPFGETCOMPONENTPATH)GetProcAddress(
                    hmodStub, "FGetComponentPath");
            }

            // If we didn't get the address of FGetComponentPath
            // try mapi32.dll
            if(!pfnFGetComponentPath)
            {
                hRes = StringCchPrintfA(szDLLPath, MAX_PATH+1, "%s\\%s", 
                    szSystemDir, "mapi32.dll");
                if(SUCCEEDED(hRes))
                {
                    // Load mapi32.dll
                    hmodMapi32 = LoadLibraryA(szDLLPath);
                    if(hmodMapi32)
                    {
                        // Get the address of FGetComponentPath from mapi32
                        pfnFGetComponentPath = (LPFGETCOMPONENTPATH)GetProcAddress(
                            hmodMapi32, "FGetComponentPath");
                    }
                }
            }

            BOOL bRet = FALSE;

            if(pfnFGetComponentPath)
            {
                // Now that we have the address of FGetComponentPath
                // Let's call it with the GUID for mapisvc.inf
                bRet = pfnFGetComponentPath(
                    "{473FF9A0-D659-11D1-A4B2-006008AF820E}",
                    NULL, szINIFileName, cchINIFileName, TRUE); 
            }

            // If FGetComponentPath returns FALSE or if
            // it returned nothing, or if we never found an
            // address of FGetComponentPath, then
            // just default to the system directory
            if(!bRet || szINIFileName[0] == '\0')
            {
                hRes = StringCchPrintfA(szINIFileName, cchINIFileName,
                    "%s\\%s", szSystemDir, "mapisvc.inf");
            }

            if(hmodMapi32)
                FreeLibrary(hmodMapi32);

            if(hmodStub)
                FreeLibrary(hmodStub);
        }
    }
}

???????

???? ???????: 229700 - ????? ??? ??????: 20/???/1426 - ??????: 5.1
????? ???
  • Microsoft Office Outlook 2003
  • Microsoft Outlook 2002 Standard Edition
  • Microsoft Outlook 2000 Standard Edition
  • Microsoft Messaging Application Programming Interface
????? ??????: 
kbhowto kbmsg kbfaq KB229700 KbMtar kbmt
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????. ??? ?? ???? ??? ??????? ????? ?? ???????? ?? ??? ???????? ?????? ????? ????????? ??????? ???? ??? ???????
???? ??? ????? ??????? ?????? ??????????229700

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com