IMAPIMessageSite::GetMessage

Last modified: July 23, 2011

Applies to: Outlook

Returns the current message.

HRESULT GetMessage(
  LPMESSAGE FAR * ppmsg
);

ppmsg

[out] A pointer to a pointer to the returned interface for the message.

S_OK

The call succeeded and has returned the expected value or values.

S_FALSE

No message currently exists for the calling form.

Forms call the IMAPIMessageSite::GetMessage method to obtain a message interface for the current message. The current message is the same message as was previously passed in the IPersistMessage::InitNew, IPersistMessage::Load, or IPersistMessage::SaveCompleted method.

GetMessage returns S_FALSE if no message currently exists. This state can occur after calls to the IPersistMessage::HandsOffMessage method or before the next call to IPersistMessage::Load or IPersistMessage::SaveCompleted is made.

For a list of interfaces related to form servers, see MAPI Form Interfaces.

For MFCMAPI sample code, see the following table.

File

Function

Comment

MyMAPIFormViewer.cpp

CMyMAPIFormViewer::GetSession

MFCMAPI uses the IMAPIMessageSite::GetMessage method to return the currently cached message pointer, if it is available.

Show:
© 2015 Microsoft