Lm th? no ? xc ?nh v? tr ng ?ng d?n ?n t?p tin Mapisvc.inf trong Microsoft Outlook

D?ch tiu ? D?ch tiu ?
ID c?a bi: 229700 - Xem s?n ph?m m bi ny p d?ng vo.
Bung t?t c? | Thu g?n t?t c?


Microsoft Outlook cho th?y nhi?u cc FGetComponentPath ch?c nng trong file t?p Mapistub.dll gip b?n t?m ?ng d?n ?n t?p tin Mapisvc.inf. Bi vi?t ny m t? cch t?m ?ng d?n ?n t?p Mapisvc.Inf b?ng cch s? d?ng m?u m? trong ph?n "Thng tin thm".

Tr?c khi Microsoft Outlook 2000, cc t?p tin Mapisvc.inf ? lun lun ?c d?i th m?c h? th?ng, khi quay tr? v? b?i Win32 API GetSystemDirectory ch?c nng.


Chu y M?u m? sau y l tng thch v?i t?t c? cc phin b?n tr?c c?a Outlook. M?u m? sau y t?m th?y ?ng d?n ?n t?p tin Mapisvc.inf cho d Mapisvc.inf t?p ny khng theo th m?c h? th?ng hay khng.
(LPSTR szComponent,
 LPSTR szQualifier,
 LPSTR szDllPath,
 DWORD cchBufferSize,
 BOOL fInstall);

// 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");
            LPFGETCOMPONENTPATH pfnFGetComponentPath = NULL;

            HMODULE hmodStub = 0;
            HMODULE hmodMapi32 = 0;

            // Load mapistub.dll
            hmodStub = LoadLibraryA(szDLLPath);
                // 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
                hRes = StringCchPrintfA(szDLLPath, MAX_PATH+1, "%s\\%s", 
                    szSystemDir, "mapi32.dll");
                    // Load mapi32.dll
                    hmodMapi32 = LoadLibraryA(szDLLPath);
                        // Get the address of FGetComponentPath from mapi32
                        pfnFGetComponentPath = (LPFGETCOMPONENTPATH)GetProcAddress(
                            hmodMapi32, "FGetComponentPath");

            BOOL bRet = FALSE;

                // Now that we have the address of FGetComponentPath
                // Let's call it with the GUID for mapisvc.inf
                bRet = pfnFGetComponentPath(
                    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");



Thu?c tnh

ID c?a bi: 229700 - L?n xem xt sau cng: 21 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft Office Outlook 2003
  • Microsoft Outlook 2002 Standard Edition
  • Microsoft Outlook 2000 Standard Edition
  • Microsoft Messaging Application Programming Interface
T? kha:
kbhowto kbmsg kbmt KB229700 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:229700

Cung cp Phan hi


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