IAddrBook::CompareEntryIDs

The IAddrBook::CompareEntryIDs method compares two entry identifiers belonging to a particular address book provider to determine if they refer to the same address book object.

Quick Info

See IAddrBook : IMAPIPropG38_SD.

 

HRESULT CompareEntryIDs(

    ULONG cbEntryID1,

 

    LPENTRYID lpEntryID1,

 

    ULONG cbEntryID2,

 

    LPENTRYID lpEntryID2,

 

    ULONG ulFlags,

 

    ULONG FAR * lpulResult

 

   )

 

 

Parameters

cbEntryID1

[in] Count of bytes in the entry identifier pointed to by the lpEntryID1 parameter.

lpEntryID1

[in] Pointer to the first entry identifier to be compared.

cbEntryID2

[in] Count of bytes in the entry identifier pointed to by the lpEntryID2 parameter.

lpEntryID2

[in] Pointer to the second entry identifier to be compared.

ulFlags

Reserved; must be zero.

lpulResult

[out] Pointer to the result of the comparison. The contents of lpulResult is set to TRUE if the two entry identifiers refer to the same object, and FALSE otherwise.

 

Return Values

S_OK

The call succeeded and has returned the expected value or values.

MAPI_E_UNKNOWN_ENTRYID

One or both of the entry identifiers passed in with the lpEntryID1 or lpEntryID2 parameters are not recognized by any address book provider.

 

Remarks

Client applications and service providers call the IAddrBook::CompareEntryIDs method to compare two entry identifiers belonging to a single address book provider to determine if they refer to the same object. CompareEntryIDs is useful because an object can have more than one valid entry identifier; such a situation can occur, for example, after a new version of an address book provider is installed.

MAPI passes this call on to the address book provider responsible for the entry identifiers, determining the appropriate provider by matching the MAPIUIDT02NXD structure in the entry identifiers with the MAPIUID structure registered by the provider.

If the two entry identifiers refer to the same object, then CompareEntryIDs sets the contents of the lpulResult parameter to TRUE; if they refer to different objects, CompareEntryIDs sets it to FALSE. In either case, CompareEntryIDs returns S_OK. If CompareEntryIDs returns an error, which can occur if no address book provider has registered a MAPIUID structure that matches the one in the entry identifiers, clients and providers should not take any action based on the result of the comparison. They should instead take the most conservative approach to the action being performed.