Platform SDK: MAPI

Supporting Object Access and Comparison

Service providers can use the following two methods to open and compare objects belonging to their provider or to other providers:

IMAPISupport::OpenEntry

IMAPISupport::CompareEntryIDs

Like IMAPISession::OpenEntry for clients, providers can use their support object's OpenEntry method to access any object as long they know the object's entry identifier. Unlike the session method, the support method requires that you specify a valid entry identifier in the lpEntryID parameter. It cannot be NULL.

To illustrate how a transport provider might use IMAPISupport::OpenEntry, consider the following scenario. The transport provider has received a message formatted in Rich Text Format and does not know if the target recipient can handle this format. Before delivering the message, the transport provider needs to:

  1. Call the message's IMessage::GetRecipientTable method to access the recipient table and the recipient's entry identifier, its PR_ENTRYID property.
  2. Pass the entry identifier to IMAPISupport::OpenEntry to open the recipient, typically either a messaging user or distribution list. The lpInterface parameter should be set to NULL because the provider cannot know ahead of time the object type of the recipient.

    The support object's OpenEntry method calls IMAPISession::OpenEntry to determine the address book provider responsible for the recipient.The session object then calls the appropriate address book provider's OpenEntry method to open the recipient and return an interface pointer to the transport provider.

  3. Call the recipient's IMAPIProp::GetProps method to retrieve its PR_SEND_RICH_INFO property. If PR_SEND_RICH_INFO is set to TRUE, the recipient can handle formatted text.

If you have opened several objects from other providers, you may need to find out if two entry identifiers refer to the same object. For example, you may have a short-term entry identifier and a long-term entry identifier and these identifiers may or may not identify the same object. To avoid redundant processing, call the IMAPISupport::CompareEntryIDs method to compare these entry identifiers. You must use this method for entry identifier comparison because entry identifiers cannot be compared directly.