IProfAdmin::AdminServices
Provides access to a message service administration object for making changes to the message services in a profile.
HRESULT AdminServices( LPTSTR lpszProfileName, LPTSTR lpszPassword, ULONG_PTR ulUIParam, ULONG ulFlags, LPSERVICEADMIN FAR * lppServiceAdmin );
Parameters
- lpszProfileName
-
[in] A pointer to the name of the profile to be modified. The lpszProfileName parameter must not be NULL.
- lpszPassword
-
[in] Always NULL.
- ulUIParam
-
[in] A handle of the parent window for any dialog boxes or windows that this method displays.
- ulFlags
-
[in] A bitmask of flags that controls the retrieval of the message service administration object. The following flags can be set:
- MAPI_DIALOG
-
Enables the display of a user interface.
- MAPI_UNICODE
-
The profile name is in Unicode format. If the MAPI_UNICODE flag is not set, the name is in ANSI format.
- lppServiceAdmin
-
[out] A pointer to a pointer to a message service administration object.
- S_OK
-
The message service administration object was successfully returned.
- MAPI_E_LOGON_FAILED
-
The specified profile does not exist, or the password was wrong and a dialog box could not be displayed to the user to request the correct password because MAPI_DIALOG was not set in ulFlags.
- MAPI_E_USER_CANCEL
-
The user canceled the operation, typically by clicking the Cancel button in a dialog box.
Although you can retrieve an IMsgServiceAdmin pointer by calling either this method or IMAPISession::AdminServices, call IProfAdmin::AdminServices if you have strictly a configuration client and offer no messaging features. IProfAdmin::AdminServices does not create a session object and does not load any service providers, which enhances performance.
You cannot use IProfAdmin::AdminServices to create a profile. Therefore, you must specify an existing valid profile in lpszProfileName. If the specified profile does not exist, IProfAdmin::AdminServices returns MAPI_E_LOGON_FAILED.
The name of the profile can be up to 64 characters in length and can include the following characters:
-
All alphanumeric characters, including accent characters and the underscore character.
-
Embedded spaces, but not leading or trailing spaces.