IMsgServiceAdmin::CopyMsgService

The IMsgServiceAdmin::CopyMsgService method copies a message service into a profile.

Quick Info

See IMsgServiceAdmin : IUnknown.

HRESULT CopyMsgService(
  LPMAPIUID lpUID,         
  LPTSTR lpszDisplayName,   
  LPCIID lpInterfaceToCopy,   
  LPCIID lpInterfaceDst,   
  LPVOID lpObjectDst,      
  ULONG ulUIParam,         
  ULONG ulFlags            
);
 

Parameters

lpUID
[in] Pointer to the MAPIUID structure holding the unique identifier of the message service to copy.
lpszDisplayName
[in] Pointer to the display name of the message service to copy.
lpInterfaceToCopy
[in] Pointer to the interface identifier (IID) representing the interface to be used to access the profile section of the message service to copy. Passing NULL results in the standard profile section interface, IProfSect, being used.
lpInterfaceDst
[in] Pointer to the IID representing the interface to be used to access the object pointed to by the lpObjectDst parameter. Passing NULL results in the session interface, IMAPISession, being used. The lpInterfaceDst parameter can also be set to IID_IMsgServiceAdmin.
lpObjectDst
[in] Pointer to a pointer to a session or message service administration object. The type of object should correspond to the interface identifier passed in lpInterfaceDst. Valid object pointers are LPMAPISESSION and LPSERVICEADMIN.
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 message service is copied. The following flags can be set:
MAPI_UNICODE
The display name of the message service is in Unicode format. If the MAPI_UNICODE flag is not set, the display name is in ANSI format.
SERVICE_UI_ALWAYS
Requests that the message service always display a configuration property sheet.

Return Values

S_OK
The message service was successfully copied.
MAPI_E_NO_ACCESS
The message service is already in the profile and does not allow multiple instances of itself.
MAPI_E_NOT_FOUND
The MAPIUID pointed to by lpUID does not refer to an existing message service.

Remarks

The IMsgServiceAdmin::CopyMsgService method copies a message service into a profile, either the active profile or another profile. The profile containing the message service to be copied and the destination do not have to be the same profile, but they can be.

The message service's entry point function is not called for a copy operation. The copied message service has the same configuration settings as its original. To change these settings, a client should call the IMsgServiceAdmin::ConfigureMsgService method.

See Also

IMsgServiceAdmin::ConfigureMsgService, MAPIUID