IMAPIViewContext::SetAdviseSink

Last modified: July 23, 2011

Applies to: Outlook

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

HRESULT SetAdviseSink(
LPMAPIFORMADVISESINK pmvns
);

pmvns

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

S_OK

The registration or cancellation for form notification succeeded.

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.

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.

For MFCMAPI sample code, see the following table.

File

Function

Comment

MyMAPIFormViewer.cpp

CMyMAPIFormViewer::SetAdviseSink

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

Show: