ssswamii

ssswamii

  • NA
  • 180
  • 0

Microsoft web browser AX control

Oct 15 2003 11:28 AM
Hi all I'm having a bit of trouble with the Microsoft ActiveX web browser control. After I placed it on a WinForm and set up events, I tried to set up an event for catching the NewWindow2 event, which is fired whenever a new browser window should appear. My problem is that once the event is fired, I don't know how to make it launch a new instance of my browser program. MSDN says the AxSHDocVw.DWebBrowserEvents2_NewWindow2Event parameter has a .ppDisp variable (and it does) which I can set to be an instance of my custom web browser - but it apparently doesn't work. Here's my code private void htmlControl_NewWindow2(object sender, AxSHDocVw.DWebBrowserEvents2_NewWindow2Event e) { MyBrowserControl childBrowser = new MyBrowserControl(); e.ppDisp = childBrowser.htmlControl; // .htmlControl is the MS ActiveX web browser control childBrowser.ShowDialog(); } This doesn't work - no new window pops up. What am I doing wrong here?

Answers (1)