S
Stuart Bray
Hi, I've got a problem I'm hoping someone can shed some light on.
We're fetching information about GAL users from a machine that does
*not* have Outlook installed. We use the Exchange System Manager
version of MAPI, since it has been recommended that Outlook not be
installed on server machines. The problem is that the Entry ID we
get from our server machine (with ESM MAPI) is not the same as the
EntryID we get from a machine with Outlook installed - it appears to
be much shorter, maybe because it's not cached? This ID cannot be
used to open the contact with IAddrBook:etails on any other machine
that has Outlook installed; it's returning MAPI_E_NOT_FOUND.
Anyone know a solution?
Here's how we're getting PR_ENTRYID on the machine with Exchange
System Manager installed:
SizedSPropTagArray(3, sptaAttributes) =
{
3,
{
PR_ENTRYID,
PR_RECORD_KEY,
PR_LAST_MODIFICATION_TIME
}
};
hr = m_pGAB->GetContentsTable(unicodeFlag, &lpContentTable);
if (HR_FAILED(hr))
{
return false;
}
hr = lpContentTable->SetColumns((LPSPropTagArray)&sptaAttributes, 0);
if (HR_FAILED(hr))
{
return false;
}
// Query 25 rows at a time
hr = lpContentTable->QueryRows(25, 0, &lpRows);
while(SUCCEEDED(hr))
{
for(ULONG index = 0; index < lpRows->cRows; index++)
{
// setup the folder var's
CString strItemEID = "";
if(!IsErrorProp(lpRows->aRow[index].lpProps[0]))
{
strItemEID = CMapiUtil::Bin2Hex(
lpRows->aRow[index].lpProps[0].Value.bin.cb,
lpRows->aRow[index].lpProps[0].Value.bin.lpb
);
LOG_DEBUG(L"EID: %s", strItemEID);
}
.... and here's how we try to open this item, on a machine that has
Outlook installed:
hr := m_session.OpenAddressBook(0, PGUID(nil)^, AB_NO_DIALOG,
addrBook);
if (hr <> S_OK) or (addrBook = nil) then
begin
DoCleanup;
FatalError('TUIOutlookManipulator/ViewItem - OpenAddressBook
failed', hr, m_session);
exit;
end;
item.SetEntryIdFromString(eid);
handle := Cardinal(Application.Handle);
addrBook.Details(handle,
nil,
nil,
item.m_eidLength,
item.m_eid,
nil,
nil,
nil,
DIALOG_MODAL);
Any suggestions would be greatly appreciated!
We're fetching information about GAL users from a machine that does
*not* have Outlook installed. We use the Exchange System Manager
version of MAPI, since it has been recommended that Outlook not be
installed on server machines. The problem is that the Entry ID we
get from our server machine (with ESM MAPI) is not the same as the
EntryID we get from a machine with Outlook installed - it appears to
be much shorter, maybe because it's not cached? This ID cannot be
used to open the contact with IAddrBook:etails on any other machine
that has Outlook installed; it's returning MAPI_E_NOT_FOUND.
Anyone know a solution?
Here's how we're getting PR_ENTRYID on the machine with Exchange
System Manager installed:
SizedSPropTagArray(3, sptaAttributes) =
{
3,
{
PR_ENTRYID,
PR_RECORD_KEY,
PR_LAST_MODIFICATION_TIME
}
};
hr = m_pGAB->GetContentsTable(unicodeFlag, &lpContentTable);
if (HR_FAILED(hr))
{
return false;
}
hr = lpContentTable->SetColumns((LPSPropTagArray)&sptaAttributes, 0);
if (HR_FAILED(hr))
{
return false;
}
// Query 25 rows at a time
hr = lpContentTable->QueryRows(25, 0, &lpRows);
while(SUCCEEDED(hr))
{
for(ULONG index = 0; index < lpRows->cRows; index++)
{
// setup the folder var's
CString strItemEID = "";
if(!IsErrorProp(lpRows->aRow[index].lpProps[0]))
{
strItemEID = CMapiUtil::Bin2Hex(
lpRows->aRow[index].lpProps[0].Value.bin.cb,
lpRows->aRow[index].lpProps[0].Value.bin.lpb
);
LOG_DEBUG(L"EID: %s", strItemEID);
}
.... and here's how we try to open this item, on a machine that has
Outlook installed:
hr := m_session.OpenAddressBook(0, PGUID(nil)^, AB_NO_DIALOG,
addrBook);
if (hr <> S_OK) or (addrBook = nil) then
begin
DoCleanup;
FatalError('TUIOutlookManipulator/ViewItem - OpenAddressBook
failed', hr, m_session);
exit;
end;
item.SetEntryIdFromString(eid);
handle := Cardinal(Application.Handle);
addrBook.Details(handle,
nil,
nil,
item.m_eidLength,
item.m_eid,
nil,
nil,
nil,
DIALOG_MODAL);
Any suggestions would be greatly appreciated!