次の方法で共有


IMsgServiceAdmin::CopyMsgService

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Copies a message service into a profile.

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

Parameters

  • lpUID
    [in] A pointer to the MAPIUID structure that contains the unique identifier of the message service to copy.

  • lpszDisplayName
    [in] This parameter has been deprecated.

  • lpInterfaceToCopy
    [in] A pointer to the interface identifier (IID) that represents 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] A pointer to the IID that represents 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] A 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] A handle to the parent window of any dialog boxes or windows this method displays.

  • ulFlags
    [in] A bitmask of flags that controls how the message service is copied. The following flags can be set:

    • SERVICE_UI_ALWAYS
      Requests that the message service always display a configuration property sheet.

Return Value

  • 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 that contains 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

Reference

IMsgServiceAdmin::ConfigureMsgService

MAPIUID

IMsgServiceAdmin : IUnknown