The OpenAttach method opens an attachment.
HRESULT OpenAttach ( ULONG ulAttachmentNum, LPCIID lpInterface, ULONG ulFlags, LPATTACH FAR * lppAttach );
[in] Index number of the attachment to open, specified by the lpulAttachmentNum parameter of IMessage::CreateAttach from when the attachment was created.
[out] Reference to the open attachment.
This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:
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.
Pocket PC: Pocket PC 2002 and later
Smartphone: Smartphone 2002 and later
OS Versions: Windows CE 3.0 and later
Send Feedback on this topic to the authors