Last modified: July 23, 2011

Applies to: Outlook

Cancels a registration for notifications with a form viewer previously established by calling IMAPIForm::Advise.

HRESULT Unadvise(
  ULONG ulConnection


[in] A connection number that identifies the notification registration to be canceled.


The registration was canceled.


The connection number passed in the ulConnection parameter does not represent a valid registration.

Form viewers call the IMAPIForm::Unadvise method to cancel a registration for notification that they first established by calling the IMAPIForm::Advise method.

Discard the pointer that you are holding to the form viewer's view advise sink by calling its IUnknown::Release method. Generally, Release is called during the Unadvise call. However, if another thread is in the process of calling one of the IMAPIViewAdviseSink methods for the view advise sink, delay the Release call until the IMAPIViewAdviseSink method returns.