Many directory properties are of the type PT_OBJECT. To access the properties of this type declared in EMSABTAG.H, use the IMAPITable interface. The following procedure illustrates this method by accessing the Manager (PR_EMS_AB_MANAGER) and Reports (PR_EMS_AB_REPORTS) properties.
hr = HrCreateDirEntryId(
szDN,
&cbEntryID,
&lpEntryID);
LPMAPIPROP lpObject = NULL;
hr = MAPICALL(lpSession)->OpenEntry(
lpSession,
cbEntryID,
lpEntryID,
NULL,
0,
&ulObjType,
(LPUNKNOWN FAR *)&lpObject);
For each of the PR_EMS_AB_MANAGER and PR_EMS_AB_REPORTS properties you want to access, perform the following steps:
LPMAPITABLE lpTable = NULL;
hr = MAPICALL(lpObject)->OpenProperty(
lpObject,
ulPropTag,
(LPIID)&IID_IMAPITable,
0,
MAPI_DEFERRED_ERRORS,
(LPUNKNOWN *)&lpTable);
LPSRowSet lpRows = NULL;
hr = HrQueryAllRows(lpTable, NULL, NULL, NULL, 0, &lpRows);