IMAPIForm::Advise

The IMAPIForm::Advise method registers a form viewer for notifications about events affecting the form.

Quick Info

See IMAPIForm : IUnknown.

HRESULT Advise(
  LPMAPIVIEWADVISESINK pAdvise,   
  ULONG FAR * pulConnection       
);
 

Parameters

pAdvise
[in] Pointer to a view advise sink object to receive the subsequent notifications.
pulConnection
[out] Pointer to a nonzero value that represents the successful notification registration.

Return Values

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 on the notification process in general, see Event Notification in MAPI.

For more information about notification and forms, see Sending and Receiving Form Notifications.

See Also

IMAPIForm::Unadvise, IMAPIViewAdviseSink : IUnknown