Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

The CreateMessagemethod creates a new message within the current folder.

Syntax

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

Parameters

lpInterface

[in] Must be NULL.

ulFlags

[in] Must be zero.

lppMessage

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

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

CreateMessagecreates 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 lppMessagemust be released to clean up the allocated memory.

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

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 CreateMessagemethod. Then call IMessage::SubmitMessageto actually send the message.

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

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

IMAPIFolder

Other Resources

Messaging