Modifying Returned Contact Information (Windows CE 5.0)
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:
- 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.
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.
- 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.
- 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.
- Modify the IExchangeClientContactInformation interface to contain methods to return the new fields by doing the following:
- Open IExchangeClient.idl, located in %_WINCEROOT%\Public\VoIP\OAK\Phone\OWAExchangeClient\Guid.
- Locate the interface declaration for IExchangeClientContactInformation interface and add a method for each new field, matching the structure of the existing methods.
- Modify the IExchangeClientContactInformation implementation to return the new fields by doing the following:
- Open ContactsInformation.cpp, located in %_WINCEROOT%\Public\VoIP\OAK\Phone\OWAExchangeClient\Contacts.
- 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.
See Also
Exchange Client Application Development
Send Feedback on this topic to the authors