Lm th? no ? t?o MAPI h? s m khng ci ?t Outlook

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

? Trang ny

TM T?T

M?t quan ni?m sai l?m ph? bi?n l m?t ?ng d?ng khch MAPI, ch?ng h?n nh Microsoft Outlook ho?c cc khch hng trao ?i, ph?i ?c ci ?t trn m?t my ch? Microsoft Exchange ? t?o h? s MAPI. Ci ?t m?t my khch MAPI v? l? do ny l khng c?n thi?t. Outlook, chng ti khng khuy?n khch b?n ci ?t m?t my khch MAPI cho my ch? s?n xu?t. Khi m?t h? th?ng ph? MAPI ?c ci ?t, m?t s? cch khc t?n t?i ? t?o h? s MAPI. ?i l?i, m?t h? th?ng ph? MAPI ?c ci ?t.

THNG TIN THM

Phng php c?a vi?c t?o ra cc c?u h?nh MAPI

Microsoft cung c?p l?p tr?nh v d? ? minh ho? ch?, khng c b?o hnh ho?c th? hi?n hay ng? ?. i?u ny bao g?m, nhng khng gi?i h?n, b?o ?m ng? ? kh? nng bn hng ho?c cho m?t m?c ch c? th?. Bi vi?t ny gi? ?nh r?ng b?n ? quen thu?c v?i ngn ng? l?p tr?nh m ang ?c ch?ng minh v v?i nh?ng cng c? ?c s? d?ng ? t?o ra v g? l?i th? t?c. Microsoft h? tr? cc k? s c th? gip gi?i thch cc ch?c nng c?a m?t th? t?c c? th?, nhng h? s? khng s?a ?i nh?ng v d? ? cung c?p thm ch?c nng ho?c xy d?ng quy tr?nh ? p ?ng cc yu c?u c? th? c?a b?n.

Tr?c khi b?n th? m?t trong nh?ng phng php ny, b?n s? ph?i ?m b?o r?ng cc m?c nh?p chnh xc ?c th?c hi?n ? cc t?p tin Mapisvc.inf trn my ch?.? bi?t thm chi ti?t v? lm th? no ? s?a ?i cc t?p tin ny, nh?p vo s? bi vi?t sau y ? xem bi vi?t trong c s? ki?n th?c Microsoft:
294470Lm th? no ? thm cc m?c cho cc d?ch v? trao ?i ? Mapisvc.inf

S? d?ng NewProf.exe

Cc ti?n ch NewProf.exe ?c bao g?m v?i Outlook. ? bi?t thm chi ti?t v? lm th? no ? s? d?ng ti?n ch ny, gh thm Web site sau c?a Microsoft Developer Network (MSDN):
http://msdn2.Microsoft.com/en-US/Library/ms527375.aspx
? bi?t thm chi ti?t, nh?p vo s? bi vi?t sau ? xem cc bi vi?t trong c s? ki?n th?c Microsoft:
145905Ty ch?n d?ng l?nh Newprof.exe
148664 M t? c?a t?p tin m t? c?u h?nh

S? d?ng m?u ProfMan2

M?u ny s? d?ng giao di?n MAPI IProfAdmin ?c ? c?p trong ph?n "S? d?ng giao di?n MAPI IProfAdmin". ? c ?c m?u ny, nh?p vo s? bi vi?t sau y ? xem bi vi?t trong c s? ki?n th?c Microsoft:
228736 Profman2.exe - MAPI Qu?n l H? s v2.0

S? d?ng ch?c nng MAPILogonEx

Khi b?n g?i cc MAPILogonEx ch?c nng m khng c ch? ?nh c?u h?nh v b?ng cch ?t c? MAPI_LOGON_UI, MAPI hi?n thu?t s? sng t?o h? s n?u khng c h? s khng trn my tnh. N?u h? s t?n t?i, MAPI s? hi?n th? cc Ch?n h? s h?p tho?i. Nh?p vo M?i ? ch?y thu?t s? sng t?o h? s.
Ma mu
// CreateProfileWithMAPILogonEx function: This takes advantage of the 
// profile prompt dialog's "New" button.
bool CreateProfileWithMAPILogonEx()
{
    HRESULT         hRes = S_OK;        // Return code from MAPI calls.
    LPMAPISESSION   lpSession = NULL;   // MAPI Session pointer.

    // Initialize MAPI.
    if (FAILED(hRes = MAPIInitialize(NULL)))
    {
        cout<<"Error initializing MAPI. hRes = 0x"<<hex<<hRes<<dec<<endl;
        return FALSE;
    }

    // Instruct user to click the "New" button.
    cout<<"When the \"Choose Profile\" dialog appears, click the \"New\" button"
        <<"to configure a new profile."<<endl;

    // Call MAPILogonEx to display the profile chooser dialog box.
    if (FAILED(hRes = MAPILogonEx(NULL,
                                  NULL,
                                  NULL,
                                  MAPI_LOGON_UI,
                                  &lpSession)))
    {
        cout<<"Error logging on. hRes = 0x"<<hex<<hRes<<dec<<endl;
        return FALSE;
    }

    // Log off the session.
    if (FAILED(hRes = lpSession->Logoff(0,0,0)))
    {
        cout<<"Error logging off. hRes = 0x"<<hex<<hRes<<dec<<endl;
    }

    // Release the session.
    lpSession->Release();

    // Uninitialize MAPI.
    MAPIUninitialize();

    // true, which indicates success.
    return TRUE;
}
				

S? d?ng ch?c nng LAUNCHWIZARDENTRY

Ch?c nng ny tr?c ti?p cu?c g?i thu?t s? sng t?o h? s.
Ma mu
// CreateProfileWithLAUNCHWIZARD function: This uses the LAUNCHWIZARDENTRY API
// to display the profile configuration UI.
bool CreateProfileWithLAUNCHWIZARD()
{
    HRESULT     hRes = S_OK;                    // Return code from MAPI calls.
    TCHAR       szProfName[80] = {0};           // String to hold profile name.
    LPTSTR      szServices[] = {"MSEMS", NULL}; // String to hold message service names.

    // Call LaunchWizard to add the MSEMS service.
    if (FAILED(hRes = LaunchWizard(NULL,
                                   NULL,
                                   (LPCTSTR *)szServices,
                                   80,
                                   szProfName)))
    {
        cout<<"Error launching wizard. hRes = 0x"<<hex<<hRes<<dec<<endl;
        return FALSE;
    }

    // Return true indicating success.
    return TRUE;
}
				

S? d?ng giao di?n MAPI IProfAdmin

Giao di?n MAPI ny cho php b?n l?p tr?nh t?o m?t h? s m khng c s? tng tc ng?i dng.
Ma mu
// CreateProfileWithIProfAdmin function: This uses the MAPI IProfAdmin to 
// programmatically create a profile. No UI is displayed.
bool CreateProfileWithIProfAdmin()
{
    HRESULT         hRes = S_OK;            // Result from MAPI calls.
    LPPROFADMIN     lpProfAdmin = NULL;     // Profile Admin object.
    LPSERVICEADMIN  lpSvcAdmin = NULL;      // Service Admin object.
    LPMAPITABLE     lpMsgSvcTable = NULL;   // Table to hold services.
    LPSRowSet       lpSvcRows = NULL;       // Rowset to hold results of table query.
    SPropValue      rgval[2];               // Property structure to hold values we want to set.
    SRestriction    sres;                   // Restriction structure.
    SPropValue      SvcProps;               // Property structure for restriction.
    char            szProfile[80] = {0};    // String for profile name.
    char            szMailbox[80] = {0};    // String for mailbox name.
    char            szServer[80] = {0};     // String for server name.

    // This indicates columns we want returned from HrQueryAllRows.
    enum {iSvcName, iSvcUID, cptaSvc};
    SizedSPropTagArray(cptaSvc,sptCols) = { cptaSvc, PR_SERVICE_NAME, PR_SERVICE_UID };

    // Get configuration info from user.
    cout<<"Enter name for profile: ";
    cin>>szProfile;
    cout<<"Enter Exchange mailbox name: ";
    cin>>szMailbox;
    cout<<"Enter Exchange server name: ";
    cin>>szServer;

    // Initialize MAPI.

    if (FAILED(hRes = MAPIInitialize(NULL)))
    {
        cout<<"Error initializing MAPI.";
        goto error;
    }

    // Get an IProfAdmin interface.

    if (FAILED(hRes = MAPIAdminProfiles(0,              // Flags.
                                        &lpProfAdmin))) // Pointer to new IProfAdmin.
    {
        cout<<"Error getting IProfAdmin interface.";
        goto error;
    }

    // Create a new profile.

    if (FAILED(hRes = lpProfAdmin->CreateProfile(szProfile,     // Name of new profile.
                                                 NULL,          // Password for profile.
                                                 NULL,          // Handle to parent window.
                                                 NULL)))        // Flags.
    {
        cout<<"Error creating profile.";
        goto error;
    }

    // Get an IMsgServiceAdmin interface off of the IProfAdmin interface.

    if (FAILED(hRes = lpProfAdmin->AdminServices(szProfile,     // Profile that we want to modify.
                                                 NULL,          // Password for that profile.
                                                 NULL,          // Handle to parent window.
                                                 0,             // Flags.
                                                 &lpSvcAdmin))) // Pointer to new IMsgServiceAdmin.
    {
        cout<<"Error getting IMsgServiceAdmin interface.";
        goto error;
    }

    // Create the new message service for Exchange.

    if (FAILED(hRes = lpSvcAdmin->CreateMsgService("MSEMS",     // Name of service from MAPISVC.INF.
                                                   NULL,        // Display name of service.
                                                   NULL,        // Handle to parent window.
                                                   NULL)))      // Flags.
    {
        cout<<"Error creating Exchange message service.";
        goto error;
    }
        
    // You now have to obtain the entry id for the new service.
    // You can do this by getting the message service table
    // and getting the entry that corresponds to the new service.

    if (FAILED(hRes = lpSvcAdmin->GetMsgServiceTable(0,                 // Flags.
                                                     &lpMsgSvcTable)))  // Pointer to table.
    {
        cout<<"Error getting Message Service Table.";
        goto error;
    }

    // Set up restriction to query table.

    sres.rt = RES_CONTENT;
    sres.res.resContent.ulFuzzyLevel = FL_FULLSTRING;
    sres.res.resContent.ulPropTag = PR_SERVICE_NAME;
    sres.res.resContent.lpProp = &SvcProps;

    SvcProps.ulPropTag = PR_SERVICE_NAME;
    SvcProps.Value.lpszA = "MSEMS";

    // Query the table to obtain the entry for the newly created message service.

    if (FAILED(hRes = HrQueryAllRows(lpMsgSvcTable,
                                     (LPSPropTagArray)&sptCols,
                                     &sres,
                                     NULL,
                                     0,
                                     &lpSvcRows)))
    {
        cout<<"Error querying table for new message service.";
        goto error;
    }

    // Set up a SPropValue array for the properties that you have to configure.

    // First, the server name.
    ZeroMemory(&rgval[1], sizeof(SPropValue) );
    rgval[1].ulPropTag = PR_PROFILE_UNRESOLVED_SERVER;
    rgval[1].Value.lpszA = szServer;

    // Next, the mailbox name.
    ZeroMemory(&rgval[0], sizeof(SPropValue) );
    rgval[0].ulPropTag = PR_PROFILE_UNRESOLVED_NAME; 
    rgval[0].Value.lpszA = szMailbox;

    // Configure the message service by using the previous properties.

        if (FAILED(hRes = lpSvcAdmin->ConfigureMsgService(
        (LPMAPIUID)lpSvcRows->aRow->lpProps[iSvcUID].Value.bin.lpb, // Entry ID of service to configure.
        NULL,                                                       // Handle to parent window.
        0,                                                          // Flags.
        2,                                                          // Number of properties we are setting.
        rgval)))                                                    // Pointer to SPropValue array.
    {
        cout<<"Error configuring message service.";
        goto error;
    }

    goto cleanup;

error:
    cout<<" hRes = 0x"<<hex<<hRes<<dec<<endl;
    return FALSE;

cleanup:
    // Clean up.
    if (lpSvcRows) FreeProws(lpSvcRows);
    if (lpMsgSvcTable) lpMsgSvcTable->Release();
    if (lpSvcAdmin) lpSvcAdmin->Release();
    if (lpProfAdmin) lpProfAdmin->Release();

    MAPIUninitialize();
    return TRUE;

}
				

M?u

Sau y t?p tin c s?n ? t?i v? t? Microsoft Download Trung tm:
Profiler.exe
Ngy pht hnh: Ngy 22 thng 10 nm 2001

? bi?t thm thng tin v? cch t?i xu?ng cc t?p h? tr? Microsoft, hay b?m s? bi vi?t sau ? xem bi vi?t trong C s? Ki?n th?c Microsoft:
119591 Cach tai xung cac tp h tr cua Microsoft t dich vu trc tuyn
Microsoft a quet vi-rut cho tp nay. Microsoft a s dung phn mm do tim vi-rut mi nht hin co vao ngay tp c ng. Tp nay lu trn may chu c tng cng bao mt giup ngn chn moi thay i trai phep i vi tp. Profiler.exe l m?t m?u n gi?n Microsoft Visual C++ m minh ho? phng php 3 thng qua 10 below. Cc t?p tin Profiler.exe ch?a cc t?p tin theo y:

Thu g?n b?ng nyBung r?ng b?ng ny
Tn tpKich thc
Profiler.DSW1 KB
Profiler.DSP5 KB
Profiler.CPP12 KB

Thu?c tnh

ID c?a bi: 306962 - L?n xem xt sau cng: 27 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft Exchange Server 2003 Enterprise Edition
  • Microsoft Exchange Server 2003 Standard Edition
  • Microsoft Exchange 2000 Server Standard Edition
  • Microsoft Exchange Server 5.5 Standard Edition
  • Microsoft Messaging Application Programming Interface
T? kha:
kbdownload kbhowto kbmsg kbmt KB306962 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:306962

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