Share via


IMessage::OpenAttach

4/8/2010

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
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2002 and later, Smartphone 2002 and later

See Also

Reference

IMessage

Other Resources

Messaging