The CreateAttach method creates a new attachment.
HRESULT CreateAttach ( LPCIID lpInterface, ULONG ulFlags, ULONG FAR * lpulAttachmentNum, LPATTACH FAR * lppAttach );
[out] Reference to an index number identifying the newly created attachment. This number is valid only when the message is open.
[out] Reference to the open attachment object.
This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:
When CreateAttach is called, the new attachment and any properties that are set for it are available immediately.
The attachment number pointed to by lpulAttachmentNum is unique and valid only within the context of the message. That is, two attachments in two different messages can have the same number while two attachments in the same message cannot.
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