IProfAdmin::CreateProfile

The IProfAdmin::CreateProfile method creates a new profile.

Quick Info

See IProfAdmin : IUnknownEHPDWT.

 

HRESULT CreateProfile(

    LPTSTR lpszProfileName,

 

    LPTSTR lpszPassword,

 

    ULONG ulUIParam,

 

    ULONG ulFlags

 

   )

 

 

Parameters

lpszProfileName

[in] Pointer to the name of the new profile.

lpszPassword

[in] Pointer to the password of the new profile.

ulUIParam

[in] Handle of the parent window for any dialog boxes or windows this method displays.

ulFlags

[in] Bitmask of flags that controls how the profile is created. The following flags can be set:

MAPI_DEFAULT_SERVICES

Indicates that MAPI should populate the new profile with the message services that are included in the [Default Services] section of the MAPISVC.INF file.

MAPI_DIALOG

Indicates that the configuration property sheets of each of the providers in the message services to be added can be displayed.

MAPI_UNICODE

The profile name and password are in the Unicode format. If the MAPI_UNICODE flag is not set, these strings are in the ANSI format.

 

Return Values

S_OK

The new profile was created.

MAPI_E_NO_ACCESS

The specified new profile already exists.

 

Remarks

The IProfAdmin::CreateProfile method creates a new profile.

Notes to Callers

You can call CreateProfile at application installation time or at any time during a session. When called at installation time, many of the configuration settings come from the MAPISVC.INF configuration file. When called during an active session, the settings come from the user who is prompted through a series of property sheets.

If the MAPI_DEFAULT_SERVICES flag is set in the ulFlags parameter, CreateProfile calls the message service entry point function for each message service in the [Default Services] section in the MAPISVC.INF file. Each message service entry point function is called with the ulContext parameter set to MSG_SERVICE_CREATE.

If both the MAPI_DIALOG and MAPI_DEFAULT_SERVICES flags are set, then the values in the ulUIParam and ulFlags parameters are also passed to the message service entry point function. The message service entry point functions are only called after all available information from the MAPISVC.INF file has been added to the profile.

The name of the new profile and its password 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.

 

Profile passwords are not supported on all operating system platforms; on platforms that do not support profile passwords, lpszPassword can be NULL or a pointer to a zero-length string. Currently, Windows NT Server and Windows 95 do not support passwords; Windows version 3.1 does.

See Also

IMsgServiceAdmin::ConfigureMsgService, IMsgServiceAdmin::CreateMsgService, MSGSERVICEENTRY