Partager via


IMessage::OpenAttach (Compact 7)

3/12/2014

The OpenAttach method opens an attachment.

Syntax

HRESULT OpenAttach (
  ULONG ulAttachmentNum,
  LPCIID lpInterface,
  ULONG ulFlags,
  LPATTACH FAR * lppAttach
);

Parameters

  • ulAttachmentNum
    [in] Index number of the attachment to open, specified by the lpulAttachmentNum parameter of IMessage::CreateAttach from when the attachment was created.
  • lpInterface
    [in] Ignored.
  • ulFlags
    [in] Ignored.
  • lppAttach
    [out] Reference to the open attachment.

Return Value

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

  • S_OK
    Indicates success.

Remarks

To open an attachment, you must have access to its attachment number. Call GetAttachmentTable to retrieve the message's attachment table and locate the row that represents the attachment to be opened.

Do not try to open one attachment multiple times; the results are undefined and dependent on the message store provider.

Attachments are always in the read/write mode.

Requirements

Header

mapidefs.h

Library

cemapi.lib

See Also

Reference

IMessage