You are pass a reference of a .Net wrapper object, while the event expect an
reference to an WebBrowser ActiveX object.

Signature
Sheng Jiang
Microsoft MVP in VC++
> Hi Sheng,
>
[quoted text clipped - 65 lines]
> But I never see the second alert(retry). It looks like the javascript is
> hung up on the "open" statement once the event handle code has been
executed.
> And the javascript works if we comment e.browser = form.Browser.
>
[quoted text clipped - 34 lines]
> > > url = "blank.html";
> > > w = open(url, windowName,
'width=690,height=600,screenX=0,screenY=0,scrollbars=yes,menubar=yes');
> > > ...
> > > w.document.write(s); ' write the page content
[quoted text clipped - 14 lines]
> > >
> > > Any help is appreciated.
Sean - 06 May 2008 23:16 GMT
Hi Sheng,
Thanks for your reply. I changed the Browser type from default WebBrowser to
AxSHDocVw.AxWebBrowser. But the javascript is still hung up.
string url;
private void cEXWB1_NewWindow2(object sender,
csExWB.NewWindow2EventArgs e)
{
Form1 form = new Form1();
form.navigate(url);
e.browser = form.Browser; // Browser is AxSHDocVw.AxWebBrowser type.
form.Show();
}
Here is the class Form1.
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void navigate(string url)
{
this.axWebBrowser1.Navigate(url);
}
public AxSHDocVw.AxWebBrowser Browser
{
get { return axWebBrowser1; }
set { axWebBrowser1 = value; }
}
}
Do you have any suggestion? Any help is appreciated.
> You are pass a reference of a .Net wrapper object, while the event expect an
> reference to an WebBrowser ActiveX object.
[quoted text clipped - 137 lines]
> > > >
> > > > Any help is appreciated.
Sheng Jiang[MVP] - 09 May 2008 16:14 GMT
If you can get the ActiveX's IWebBrowser2 interface, return its Application
property to NewWindow2.

Signature
Sheng Jiang
Microsoft MVP in VC++
> Hi Sheng,
>
[quoted text clipped - 62 lines]
> > > alert(retry);
> > > w = open(blankname, windowName,
'width=890,height=600,screenX=0,screenY=0,scrollbars=yes,menubar=yes');
> > > retry++;
> > > alert(retry);
[quoted text clipped - 109 lines]
> > > > >
> > > > > Any help is appreciated.