C
Count Infinity
Under certain situations I want to test for the existence of certain messages
in the store for which I have an entry ID (so I can iterate through a list,
and remove anything that doesn't exist anymore.) I tried the following:
if (m_pSession->CompareEntryIDs(id.cb, (LPENTRYID)id.lpb, id.cb,
(LPENTRYID)id.lpb, 0, &ul) != MAPI_E_UNKNOWN_ENTRYID)
{
// This code should only execute if the ID is not valid...right?
}
Notice that I compare the id against itself. I would expect this to always
return S_OK unless the id was not valid. This seemed to work on my computer,
however, in testing we found at least one computer where CompareEntryIDs was
returning MAPI_E_UNKNOWN_ENTRYID around 50% of the time, even when id
contained a valid entryid. The computer in question was a tablet PC running
XP SP2 and Outlook 2003 w/ Exchange Server 2003.
I don't need a workaround, I have another solution in place for now. My
question is WHY this function would fail so badly on perhaps the easiest
possible case. I need to know, since I obviously have to use CompareEntryIDs
for more normal things. Any ideas?
in the store for which I have an entry ID (so I can iterate through a list,
and remove anything that doesn't exist anymore.) I tried the following:
if (m_pSession->CompareEntryIDs(id.cb, (LPENTRYID)id.lpb, id.cb,
(LPENTRYID)id.lpb, 0, &ul) != MAPI_E_UNKNOWN_ENTRYID)
{
// This code should only execute if the ID is not valid...right?
}
Notice that I compare the id against itself. I would expect this to always
return S_OK unless the id was not valid. This seemed to work on my computer,
however, in testing we found at least one computer where CompareEntryIDs was
returning MAPI_E_UNKNOWN_ENTRYID around 50% of the time, even when id
contained a valid entryid. The computer in question was a tablet PC running
XP SP2 and Outlook 2003 w/ Exchange Server 2003.
I don't need a workaround, I have another solution in place for now. My
question is WHY this function would fail so badly on perhaps the easiest
possible case. I need to know, since I obviously have to use CompareEntryIDs
for more normal things. Any ideas?