A RuntimeError

  • From: "Bryan Garaventa" <bc@xxxxxxxxxxxxxx>
  • To: <jfw@xxxxxxxxxxxxx>
  • Date: Mon, 21 Mar 2005 13:43:55 -0800

Hello,

I've been getting this error message for a while now, and can't seem to find 
a work-around for it.



Error

A Runtime Error has occurred.graphic 580  Do you wish to Debug?

Line: 30

Error: 'windowHandle' is null or not an object

 Yes  No



Although there are no errors when compiling, this seems to originate from a 
specific section of code.



Form1 contains a WebBrowser Control, which simulates a standard IE session. 
Events generated from the Browser Control (I.E. BeforeNavigate2, 
DocumentComplete, etc.), are passed to Form1 for processing. This works 
great until a JavaScript popup window is encountered.



When such a window is clicked, the NewWindow2 event is fired as with any 
other popup window. The code I was given to handle this occurance appears to 
pass the event's functionality to the new form, but unfailingly generates 
the error message above.



This is the code I was given for the NewWindow2 event



'The code at the beginning of the NewWindow2 event

'Where Form1 is the current form

Dim frmMe as Form1



'The code after some validation procedures within the NewWindow2 event

frmMe = New Form1



e.ppDisp = frmMe.WB.Application

'Where frmMe.WB is the contained WebBrowser Control



frmMe.Text = "New Window"

                                                                             
                    frmMe.WB.Navigate(tmpURL)

'Where tmpURL is the target of the popup window



frmMe.Show()

                                                                             
                    e.cancel = True



'End code for the NewWindow2 event



The coding language is VB.net, and was written using Visual Studio.net 2003.



If you have any ideas about the problem or the solution, please let me know. 
I would greatly appreciate your help.



Thank you, and best wishes.



Bryan Garaventa

http://gutterstar.net/


--
To post a message to the list, send it to jfw@xxxxxxxxxxxxx
To unsubscribe from this mailing list, send a message to 
jfw-request@xxxxxxxxxxxxx with the word unsubscribe in the subject line.
Archives located at: //www.freelists.org/archives/jfw

If you have any concerns about the list, post received from the list, or the 
way the list is being run, do not post them to the list. Rather contact the 
list owner at jfw-admins@xxxxxxxxxxxxxx

Other related posts:

  • » A RuntimeError