IMsgServiceAdmin::CreateMsgService
Last modified: July 23, 2011
Applies to: Outlook
Deprecated: The use of IMsgServiceAdmin2::CreateMsgServiceEx is recommended. Adds a message service to the current profile.
HRESULT CreateMsgService( LPSTR lpszService, LPSTR lpszDisplayName, ULONG_PTR ulUIParam, ULONG ulFlags );
The IMsgServiceAdmin::CreateMsgService method adds a message service to the current profile. CreateMsgService calls the message service's entry point function to perform any service-specific configuration tasks. If the SERVICE_UI_ALLOWED flag is set in the ulFlags parameter, the message service being installed can display a property sheet to enable the user to configure its settings.
The MapiSvc.inf file contains the list of providers that make up a message service and the properties for each. CreateMsgService first creates a new profile section for the message service and then copies all of the information for that service from the MapiSvc.inf file into the profile, creating new sections for each provider.
After all the information has been copied from MapiSvc.inf, the message service's entry point function is called with the MSG_SERVICE_CREATE value set in the ulContext parameter. If the SERVICE_UI_ALLOWED flag is set in the CreateMsgService method's ulFlags parameter, the values in the ulUIParam and ulFlags parameters are also passed when the message service's entry point function is called. Service providers should display their configuration property sheets so users can configure the message service.
CreateMsgService does not return the MAPIUID structure for the message service that was added to the profile.
To retrieve the MAPIUID for the created message service, use the following procedure:
-
Call the IMsgServiceAdmin::GetMsgServiceTable method to get the message service administration table.
-
Locate the row that represents the message service by placing a restriction on the table that matches the PR_SERVICE_NAME (PidTagServiceName) property with the name of the message service.
-
Retrieve the service's PR_SERVICE_UID (PidTagServiceUid) property.
-
Pass the value of the PR_SERVICE_UID property in the lpUid parameter to the IMsgServiceAdmin::ConfigureMsgService method to configure the service.
Caution
|
|---|
|
The Microsoft Outlook 2010 implementation of the MAPI subsystem does not support MAPI_UNICODE and will fail if it is used. |
Important
|
|---|
|
The ulFlags SERVICE_NO_RESTART_WARNING might not be defined in the downloadable header file you currently have, in which case you can add it to your code using the following value: #define SERVICE_NO_RESTART_WARNING 0x00000080 |
Caution