Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IMAPIFolder::CreateMessage

Windows Mobile 6.5
4/8/2010

The CreateMessage method creates a new message within the current folder.


HRESULT CreateMessage (
  LPCIID lpInterface,
  ULONG ulFlags,
  LPMESSAGE FAR * lppMessage
);

lpInterface

[in] Must be NULL.

ulFlags

[in] Must be zero.

lppMessage

[out] Reference to the newly created message, implemented on IMessage.

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

S_OK

Indicates success.

CreateMessage creates a new message with generic or associated content and assigns an entry identifier. The entry identifier is made up of a part that represents the message store provider and a part that represents the individual message.

The lppMessage must be released to clean up the allocated memory.

The entry identifier of the new message is available immediately after CreateMessage returns.

Expect the entry identifier assigned to the new message to be unique within the current message store as well as across all of the message stores that are open concurrently. One exception to this general rule occurs when multiple entries for a message store appear in the profile, causing the message store to be opened multiple times and entry identifiers to be duplicated.

To create an outgoing message, call the Outbox folder's CreateMessage method. Then call IMessage::SubmitMessage to actually send the message.

If you delete a folder containing a new message before the message is saved, the results are undefined.

Headermapidefs.h
Librarycemapi.lib
Windows Embedded CEWindows CE 3.0 and later
Windows MobilePocket PC 2002 and later, Smartphone 2002 and later

Reference

IMAPIFolder

Other Resources

Messaging

Community Additions

Show:
© 2015 Microsoft