Re: Open in the same window

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Leslie Milburn" <CDB4W@xxxxxxxxxxxxxxxxxx> wrote in message
news:%23nxmvPlZIHA.2268@xxxxxxxxxxxxxxxxxxxx
I am using an embedded iWebBrowser2 control and I want to keep *all*
activity in that same browser window, ie I do not want IE6 or 7 to be
opened when code like the following is executed:

var win;
win=window.open(http://server/thePage.html);

I have implemented DWebBrowser2 events and am intercepting the
NewWindow2 event to try and modify the behaviour.

According to the (very sparse and poorly written) documentation, I
should be able to provide the target WebBrowser iDispatch object by
updating pDispParams->rgvarg[1].ppdispVal in the WebEvents Invoke
function. When I do this, I get a script error on the page.

NewWindow2 approach does work. You are doing something wrong. See KB
article KB184876 "How To Use the WebBrowser Control NewWindow2 Event"
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.