IMAPISession::CompareEntryIDs
Applies to: Outlook 2013 | Outlook 2016
Compares two entry identifiers to determine whether they refer to the same object.
HRESULT CompareEntryIDs(
ULONG cbEntryID1,
LPENTRYID lpEntryID1,
ULONG cbEntryID2,
LPENTRYID lpEntryID2,
ULONG ulFlags,
ULONG FAR * lpulResult
);
Parameters
cbEntryID1
[in] The byte count in the entry identifier pointed to by the lpEntryID1 parameter.
lpEntryID1
[in] A pointer to the first entry identifier to be compared.
cbEntryID2
[in] The byte count in the entry identifier pointed to by the lpEntryID2 parameter.
lpEntryID2
[in] A pointer to the second entry identifier to be compared.
ulFlags
[in] Reserved; must be zero.
lpulResult
[out] A pointer to the result of the comparison. TRUE if the two entry identifiers refer to the same object; otherwise, FALSE.
Return value
S_OK
The comparison was successful.
MAPI_E_UNKNOWN_ENTRYID
One or both of the entry identifiers specified as parameters do not refer to objects, possibly because these objects are currently unopened and unavailable.
Remarks
The IMAPISession::CompareEntryIDs method compares two entry identifiers that belong to a single service provider to determine whether they refer to the same object. MAPI extracts the MAPIUID portion from the entry identifiers to determine the service provider responsible for the objects and then calls its logon object's CompareEntryIDs method to perform the comparison.
Notes to callers
The CompareEntryIDs method is useful because an object can have more than one valid entry identifier. This situation can occur, for example, after a new version of a service provider is installed.
If CompareEntryIDs returns an error, do not take any action based on the result of the comparison. Instead, take the most conservative approach possible. CompareEntryIDs might fail if, for example, one or both of the entry identifiers contain an invalid MAPIUID.
MFCMAPI reference
For MFCMAPI sample code, see the following table.
File | Function | Comment |
---|---|---|
BaseDialog.cpp |
CbaseDialog::OnCompareEntryIDs |
MFCMAPI uses the IMAPISession::CompareEntryIDs method to compare two entry IDs that a user enters. |