Unhandled exception using webBrowser
Hi,
I hade unhandled exception using WebBrowser and it is easy to emulate the problem. Just 2 form, and on Form2 a webbrowser component, this code on a button:
| | privatevoid button1_Click(object sender, EventArgs e) { Form2 F =new Form2(); F.ShowDialog(); }
|
When program close unhandled exception:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Is this a problem with WebBrowser in beta2 ?
David,
Do you know what the equivalent syntax would be in VB ?
| |
Private Sub button1_Click(Byval sender as Object, Byval e as EventArgs) Dim f as Form2 = New Form2 f.ShowDialog End Sub
|
ie How do I make sure the form that hosts the Webbrowser control is disposed ?
wilfridB
David,
I may be wrong but "using" is not a keyword in VB.
May be something like the following would do?
| |
Dim f As New Form2 Try f.ShowDialog() Finally f.Dispose() End Try
|
wilfridB
I was wrong actually. "Using" IS a VB keyword and the funny thing is that :
Using obj
'do something with obj
End Usingis functionaly similar to
Try
'do something with obj
Finally
obj.dispose
End Try
WilfridB
Hi,
Maybe it is a problem of WebBrowser beta 2.
I have tested the code with Visual C# 2003. No problem.
Have a fun!
Valentin
Do not hesitate to contact me!
www.wwv-it.eu