Share via


Modifying Returned Contact Information (Windows Embedded CE 6.0)

1/6/2010

The IExchangeClient::RequestContacts method initiates a search that results in the creation of a set of IExchangeClientContactInformation instances.

By default, the Exchange Client library queries for the same set of contact information that is represented by each IExchangeClientContactInformation instance. This information contains the display name, email address, home address, and so on.

You can modify the Exchange Client code to query for and return additional fields.

To add new fields, do the following:

  • Update the code that retrieves information from the Exchange server so it retrieves the new fields.
    Specific instructions for this task are outlined in the following steps 1-3.
  • Update the IExchangeClientContactInformation interface and implementation to return the new fields.
    Specific instructions for this task are outlined in the following steps 4-5.

To add new fields, complete the following:

  1. In settings.cpp, located in %_WINCEROOT%\Public\VoIP\OAK\Phone\OWAExchangeClient\Engine, make the following changes:
    • Modify the c_wszContactsBodyStartFmt variable so the select statement contains the Exchange contact schema names for the additional fields you want to return.
    • Add new c_SettingContacts* variables for each additional field, matching the structure of the already existing variables. For more information about valid fields, see the section More Information that appears later in this topic.
      Each variable maps the Exchange Client field name (for example, ContactsDispName) to the Exchange contact schema name (for example, fileas).
    • Add each new c_SettingContacts* variable to the g_OWAClientSettings variable, matching the structure of the existing entries in this variable.
  2. In the corresponding header file setting.h, located in %_WINCEROOT%\Public\VoIP\OAK\Phone\OWAExchangeClient\Engine, make the following changes:
    • Add a CONTACTS_PARSE_* constant for each variable you added in step 1, incrementing the index for each field.
    • Modify NUM_CONTACTS_PROPERTIES to contain the number of fields you retrieve from the Exchange server.
    • Add a forward declaration for each c_SettingContact* variable you added in step 1.
  3. Open ContactsFormatHandler.cpp, located in %_WINCEROOT%\Public\VoIP\OAK\Phone\OWAExchangeClient\Contacts, and add a new two-line snippet for each field in the CContactsFormatHandler::BuildParseTable method.
  4. Modify the IExchangeClientContactInformation interface to contain methods to return the new fields by doing the following:
    1. Open IExchangeClient.idl, located in %_WINCEROOT%\Public\VoIP\OAK\Phone\OWAExchangeClient\Guid.
    2. Locate the interface declaration for IExchangeClientContactInformation interface and add a method for each new field, matching the structure of the existing methods.
  5. Modify the IExchangeClientContactInformation implementation to return the new fields by doing the following:
    1. Open ContactsInformation.cpp, located in %_WINCEROOT%\Public\VoIP\OAK\Phone\OWAExchangeClient\Contacts.
    2. Add a new method implementation for each new field, following the structure of the existing Get* methods and using the CONTACTS_PARSE_* constant you defined in step 2.

More Information

For more information about the set of business and personal information management fields associated with a contact and available on Exchange Server 2003, see this Microsoft Web site.

For more information about the set of fields associated with a contact and available on Exchange Server 2007 when you use Windows Embedded CE 6.0 R2, see this Microsoft Web site.

See Also

Concepts

Exchange Client Application Development