IExplorerBrowser::Advise method (shobjidl_core.h)

Initiates a connection with IExplorerBrowser for event callbacks.

Syntax

HRESULT Advise(
  [in]  IExplorerBrowserEvents *psbe,
  [out] DWORD                  *pdwCookie
);

Parameters

[in] psbe

Type: IExplorerBrowserEvents*

A pointer to the IExplorerBrowserEvents interface of the object to be advised of IExplorerBrowser events.

[out] pdwCookie

Type: DWORD*

When this method returns, contains a token that uniquely identifies the event listener. This allows several event listeners to be subscribed at a time.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This method is called by an implementer of IExplorerBrowserEvents. The implementer (listener) is advised of ExplorerBrowser view and navigation events by callback of the methods of IExplorerBrowserEvents.

Call IExplorerBrowser::Advise to initiate an advisory connection prior to the first IExplorerBrowser navigation. Callbacks to event listeners are made as the browser is browsing.

The first browse happens synchronously to a call on IExplorerBrowser::BrowseToObject, or a similar method. Future callbacks happen asynchronously, as the browser browses.

When the connection is no longer needed, call method IExplorerBrowser::Unadvise to terminate the connection.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)

See also

IExplorerBrowser

OnNavigationComplete

OnNavigationFailed

OnViewCreated