DWebBrowserEvents2::BeforeNavigate2DWebBrowserEvents2::BeforeNavigate2*
*



Contents  *



Index  *Topic Contents
*Previous Topic: DWebBrowserEvents2
*Next Topic: DWebBrowserEvents2::CommandStateChange

DWebBrowserEvents2::BeforeNavigate2

void BeforeNavigate2(
    [in] IDispatch* pDisp, 
    [in] VARIANT* URL, 
    [in] VARIANT* Flags, 
    [in] VARIANT* TargetFrameName, 
    [in] VARIANT* PostData, 
    [in] VARIANT* Headers, 
    [out] VARIANT_BOOL* Cancel 
);

Fires before a navigation occurs in the given WebBrowser (on either a window or frameset element).

pDisp
Address of the frame's IDispatch interface.
URL
URL to be navigated to.
Flags
Reserved for future use.
TargetFrameName
String that contains the name of the frame in which to display the resource, or NULL if no named frame is targeted for the resource.
PostData
Address of data to send to the server if the HTTP POST transaction is being used.
Headers
Additional HTTP headers to send to the server (HTTP URLs only). The headers can specify things like the action required of the server, the type of data being passed to the server, or a status code.
Cancel
Address of a cancel flag. An application can set this parameter to TRUE to cancel the navigation operation, or to FALSE to allow it to proceed.

The pDisp parameter is that of the top-level or frame WebBrowser object corresponding to the navigation. The processing of this navigation can be modified by setting the Cancel parameter to TRUE and either ignoring or reissuing a modified navigation method to the WebBrowser object. The URL parameter can be a PIDL in the case of a shell namespace entity for which there is no URL representation.

The post data specified by PostData is passed as a SAFEARRAY structure. The variant should be of type VT_ARRAY and point to a SAFEARRAY. The SAFEARRAY should be of element type VT_UI1, dimension one, and have an element count equal to the number of bytes of post data.

This event replaces the BeforeNavigate and FrameBeforeNavigate events, which should no longer be used. Internet Explorer 4.0 will continue to fire the BeforeNavigate and FrameBeforeNavigate events for compatibility with Internet Explorer 3.0.

Providing the pDisp pointer of the corresponding WebBrowser object gives the host better information and control over the Internet Explorer 3.0 specification, which used FrameBeforeNavigate and a target frame name to identify the target of navigation (target frame names are not unique).

Applies To

WebBrowser, Internet Explorer

See also DWebBrowserEvents2::NavigateComplete2, IWebBrowser2::Navigate2


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.