IProfSect : IMAPIProp

The IProfSect interface is used to work with the properties of profile section objects.

Quick Info

Header file: MAPIX.H
Exposed by: Profile section objects
Implemented by: MAPI
Called by: Client applications and service providers
Interface identifier: IID_IProfSect
Pointer type: LPPROFSECT
Transaction model: Nontransacted

Vtable Order

No unique methods

Required properties Access
PR_OBJECT_TYPE Read-only
PR_PROFILE_NAME Read-only

Notes to Callers

The IProfSect interface does not have any unique methods of its own, but you can call the profile section's IMAPIProp methods. There are some differences between the IProfSect implementation and other implementations of IMAPIProp:

Not supporting a transaction model means that all changes made to a profile section following calls to the IMAPIProp::CopyProps and IMAPIProp::CopyTo methods occur immediately. Calls to the IMAPIProp::SaveChanges method succeed, but don't actually save any changes.

To be protected from changes that occur prematurely, service providers need to make copies of their profile sections that are displayed to users through property sheets. The property sheets should work with the copy, rather than the real profile section. When the user has verified that the changes are accurate by clicking the OK button, the changes can be saved to the real profile section.

    To implement a property sheet with a copied profile section
  1. Open the profile section by calling IMAPISupport::OpenProfileSection or IProviderAdmin::OpenProfileSection.
  2. Call CreateIProp to retrieve a property data object — an object that supports the IPropData interface.
  3. Call the profile section's IMAPIProp::CopyTo method to copy the properties to appear on the property sheet from the profile section to the property data object.
  4. Call IMAPISupport::DoConfigPropSheet to request that the service provider display a property sheet and pass a pointer to the property data object in the lpConfigData parameter.
  5. When the user saves changes to configuration properties in the property sheet, call the IMAPIProp::CopyTo method to copy the properties from the property data object back to the profile section.

Profile sections, unlike other objects, do not support named properties. IMAPIProp::GetIDsFromNames and IMAPIProp::GetNamesFromIDs return MAPI_E_NO_SUPPORT if called on a profile section object. Attempts to set properties with identifiers in the range above 0x8000 with IMAPIProp::SetProps return PT_ERROR as the property type.

Profile sections reserve the identifier range 0X67F0 to 0X67FF for secure properties. Service providers can use this range to store passwords and other provider-specific credentials. Properties in this range are not returned in the complete list of properties when NULL is passed in the lpPropTag parameter of the IMAPIProp::GetProps method, nor are they returned in the lppPropTagArray parameter of the IMAPIProp::GetPropList method. Secure properties must be requested specifically by their identifiers.

MAPI furnishes a profile section with the hard-coded constant MUID_PROFILE_INSTANCE as its identifier and PR_SEARCH_KEY as its single property. The PR_SEARCH_KEY property is guaranteed by MAPI to be unique among all profiles created. Use this property rather than PR_PROFILE_NAME when uniqueness is important, because it is possible for a deleted profile to be succeeded by another profile with the same name.

For more information on using profile sections, see Administering Profiles and Message Services.