Using an Address Book Container
Using an Address Book Container |
Before you can access an address book container, you must initialize the address book provider, and MAPI must log on to the address book provider. For more information, see Initializing an Address Book Provider.
After you have initialized an address book provider, you can access the address book container. The IABContainer::CreateEntry and IABContainer::DeleteEntries functions create and delete records in the address book container database. The IABContainer::ResolveNames function resolves recipient names against the address book container's content table.
In this topic, these functions are demonstrated by using code examples from the Sample Address Book Provider. The Sample Address Book Provider implements the required features of an address book provider, as well as more advanced features such as name resolution. For more information about the required features of an address book provider, see Required Features for Address Book Providers. For more information about downloading and installing the Sample Address Book Provider, see Installing the Sample Address Book Provider.
In addition to accessing the address book container, you can access address book provider resources and register to receive notifications when there is a change in the address book provider. For more information, see Accessing an Address Book Provider.
When you are finished using an address book provider, you must implement functions to properly log off and shut down the address book provider. For more information, see Shutting Down an Address Book Provider.
Create Entry Routine
The IABContainer::CreateEntry function creates an entry in the address book container and adds it to the database by creating a record. This entry can be used by a messaging user, a distribution list, or another container. A point to a pointer to the entry is returned in the lppMAPIPropEntry
parameter.
CABContainer::CreateEntry() Example
|
Resolve Names Routine
The IABContainer::ResolveNames function resolves names by calling the DoANR
function. DoANR
resolves names for one or more recipients by comparing their names with the address book container's contents table. A pointer to an ADRLIST structure that contains the list of unresolved recipients is passed in through the lpAdrList
parameter. A pointer to an ADRLIST structure that contains the list of resolved names is passed out through the lpAdrList
parameter.
CABContainer::ResolveNames() Example
|
Delete Entries Routine
The IABContainer::DeleteEntries function deletes entries from the address book container. The entries are typically messaging users, distribution lists, or other containers. A pointer to an array of ENTRYLIST structures that contain the identifiers of the entries to be deleted is passed in through the lpEntries
parameter. This parameter is converted into a list and each child is deleted from the address book container database.
CABContainer::DeleteEntries() Example
|
See Also
About the Sample Address Book Provider
Installing the Sample Address Book Provider
Initializing an Address Book Provider