共用方式為


IMAPIViewContext::SetAdviseSink

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Manages a form's registration to receive notifications about changes in the viewer.

HRESULT SetAdviseSink(
LPMAPIFORMADVISESINK pmvns
);

Parameters

  • pmvns
    [in] Pointer to a form advise sink object or NULL.

Return Value

  • S_OK
    The registration or cancellation for form notification succeeded.

Remarks

Form objects call the IMAPIViewContext::SetAdviseSink method to either register to learn about changes in the form viewer or cancel a prior registration. When pmvns is set to NULL, the form wants to cancel a registration. When pmvns points to a valid form advise sink, the form wants to register for future notifications.

Notes to Implementers

When SetAdviseSink includes a form advise sink pointer, keep a reference to it until another SetAdviseSink call is made to cancel notification. Send a notification when a change occurs in your viewer and when you are loading a new message.

For more information, see Sending and Receiving Form Notifications.

MFCMAPI Reference

For MFCMAPI sample code, see the following table.

File

Function

Comment

MyMAPIFormViewer.cpp

CMyMAPIFormViewer::SetAdviseSink

MFCMAPI implements the IMAPIViewContext::SetAdviseSink method in this function.

See Also

Concepts

MFCMAPI as a Code Sample