Partager via


IMsgStore::CompareEntryIDs

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Compares two entry identifiers to determine whether they refer to the same entry in a message store. MAPI passes this call to a service provider only if the unique identifiers (UIDs) in both entry identifiers to be compared are handled by that provider.

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 the corresponding objects are unopened and unavailable at present.

Remarks

The IMsgStore::CompareEntryIDs method compares two entry identifiers that belong to the message store to determine whether they refer to the same object.

Notes to Callers

CompareEntryIDs is useful because an object can have more than one valid entry identifier (for example, after a new version of a message store 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 contains an invalid MAPIUID.

MFCMAPI Reference

For MFCMAPI sample code, see the following table.

File

Function

Comment

BaseDialog.cpp

CBaseDialog::OnCompareEntryIDs

MFCMAPI uses the IMsgStore::CompareEntryIDs method to compare entry IDs.

See Also

Reference

MAPIUID

IMsgStore : IMAPIProp

Concepts

MFCMAPI as a Code Sample