Share via


IMAPIMessageSite::GetMessage

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 page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Returns the current message.

HRESULT GetMessage(
  LPMESSAGE FAR * ppmsg
);

Parameters

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

Return Value

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

  • S_FALSE
    No message currently exists for the calling form.

Remarks

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.

MFCMAPI Reference

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.

See Also

Reference

IPersistMessage::HandsOffMessage

IPersistMessage::InitNew

IPersistMessage : IUnknown

IPersistMessage::Load

IPersistMessage::SaveCompleted

IMAPIMessageSite : IUnknown

Concepts

MFCMAPI as a Code Sample

MAPI Form Interfaces