Implementing a Provider One-Off Table

MAPI calls your provider's IABLogon::GetOneOffTable method when the user of a client application adds a recipient to an outgoing message. Typically, the types of addresses requested are unique to your messaging system. If your provider supports recipient creation, it must supply a one-off table that exposes templates for every type of supported recipient address. If your provider does not support recipient creation, return MAPI_E_NO_SUPPORT from the GetOneOffTable call.

MAPI will typically keep your provider's one-off table open for the lifetime of the session, releasing it only when a client calls either the subsystem's or address book's IMAPIStatus::ValidateState method. MAPI registers for notifications on this table so that if templates are added or deleted, these changes can be reflected to the user.

    To implement IABLogon::GetOneOffTable
  1. Check the value of the flags parameter, ulFlags. If the MAPI_UNICODE flag is set and your provider does not support Unicode, fail and return MAPI_E_BAD_CHARWIDTH.
  2. Check if your provider's one-off table has already been created. Because one-off tables are typically static, your provider never has to go through the creation process more than once. If a table already exists, return a pointer to it.
  3. If a one-off table does not yet exist, call CreateTable to create one.
  4. Set the following properties for the columns in your table rows:
  5. Call ITableData::HrModifyRow to modify the table directly.
  6. Call ITableData::HrGetView to create an IMAPITable interface implementation to return to the caller.