Export (0) Print
Expand All

IMsgServiceAdmin::DeleteMsgService

Published: July 16, 2012

Deletes a message service from a profile.

HRESULT DeleteMsgService(
  LPMAPIUID lpuid
);

lpuid

[in] A pointer to the MAPIUID structure that contains the unique identifier for the message service to delete.

S_OK

The message service was deleted.

MAPI_E_NOT_FOUND

The MAPIUID pointed to by lpuid does not match an existing message service.

The IMsgServiceAdmin::DeleteMsgService method deletes a message service from a profile. DeleteMsgService removes all profile sections related to the message service.

DeleteMsgService performs the following steps to delete the message service:

  1. Calls the message service's entry point function with the ulContext parameter set to MSG_SERVICE_DELETE before the profile sections are removed. This allows the service to perform any service-specific tasks.

  2. Deletes the message service.

  3. Deletes the message service's profile section.

The message service's entry point function is not called again after the service has been deleted.

To retrieve the MAPIUID structure for the message service to delete, retrieve the PR_SERVICE_UID (PidTagServiceUid) property column from the message service's row in the message service table. For more information, see the procedure outlined in the IMsgServiceAdmin::CreateMsgService method.

For MFCMAPI sample code, see the following table.

File

Function

Comment

MsgServiceTableDlg.cpp

CMsgServiceTableDlg::OnDeleteSelectedItem

MFCMAPI uses the IMsgServiceAdmin::DeleteMsgService method to delete the selected service.

Community Additions

ADD
Show:
© 2014 Microsoft