MAPI Defaultprofile suchen (C++)
MAPI Programmierung ist ein Buch mit sieben Siegeln. Folgender Ausschnitt zeigt wie man in C++ herausfinden kann wie das Default Mapiprofil heisst.
SRestriction sres;
SPropValue spvDefaultProfile;
LPSRowSet pRow = NULL;
LPSTR lpDisplayName = NULL;
// Get a IProfAdmin Interface.
hr = MAPIAdminProfiles(0, &lpProfAdmin);
LPMAPITABLE lpProfileTable;
// Get the Table of Profiles
hr = lpProfAdmin->GetProfileTable(0, &lpProfileTable);
// build a restriction where PR_DEFAULT_PROFILE = TRUE
spvDefaultProfile.ulPropTag = PR_DEFAULT_PROFILE;
spvDefaultProfile.Value.b = TRUE;
sres.rt = RES_PROPERTY;
sres.res.resProperty.relop = RELOP_EQ;
sres.res.resProperty.ulPropTag = PR_DEFAULT_PROFILE;
sres.res.resProperty.lpProp = &spvDefaultProfile;
hr = lpProfileTable->Restrict(&sres, TBL_BATCH);
hr = lpProfileTable->FindRow(&sres, BOOKMARK_BEGINNING, 0);
// we have a match
hr = lpProfileTable->QueryRows(1,0,&pRow);
if (SUCCEEDED(hr))
{
lpDisplayName = pRow->aRow[0].lpProps[0].Value.lpszA;
}
Aktualisiert (Sonntag, den 24. Januar 2010 um 21:49 Uhr)