IMAPIForm::Advise
Applies to: Outlook 2013 | Outlook 2016
Registers a form viewer for notifications about events that affect the form.
HRESULT Advise(
LPMAPIVIEWADVISESINK pAdvise,
ULONG FAR * pulConnection
);
Parameters
pAdvise
[in] A pointer to a view advise sink object to receive the subsequent notifications.
pulConnection
[out] A pointer to a nonzero value that represents a successful notification registration.
Return value
S_OK
The registration was successful.
E_OUTOFMEMORY
The registration was unsuccessful because of insufficient memory.
Remarks
Form viewers call a form's IMAPIForm::Advise method to register for notification when changes occur to the form.
Notes to implementers
Keep a copy of the view advise sink pointer passed in the pAdvise parameter so that you can use it to call the appropriate IMAPIViewAdviseSink method when an event occurs. Call the view advise sink's IUnknown::AddRef method to retain the pointer until notification registration is canceled. Set the contents of the pulConnection parameter to a nonzero number.
Many forms implement a helper object to handle the registration and subsequent notification of events.
For more information about the notification process in general, see Event Notification in MAPI.
For more information about notification and forms, see Sending and Receiving Form Notifications.