Hello John,
Smth like
AddHandler Application.ThreadException, _
New ThreadExceptionEventHandler( _
AddressOf Application_ThreadException)
at your main method, and handler
Private Shared Sub Application_ThreadException( _
ByVal sender As Object, _
ByVal e As System.Threading.ThreadExceptionEventArgs)
MessageBox.Show( _
"Send the following to support: " & _
e.Exception.ToString())
End Sub
To email log use System.Net.Mail
http://weblogs.asp.net/scottgu/archi...10/432854.aspx
or 3rd party tools like log4net or Application Blogs,
btw, if your are in the web project u can use Health Monitoring features
http://msdn2.microsoft.com/en-us/library/ms178701.aspx
---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog:
http://spaces.live.com/laflour
Team blog:
http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
JHi Michael
J>
JThanks. Is there an example somewhere I can look at as to how to do
Jsome comprehensive exception handling with option to email log to the
Jdeveloper?
J>
JMany Thanks
J>
JRegards
J>
J"Michael Nemtsev" <ne*****@msn.comwrote in message
Jnews:a2***************************@msnews.microso ft.com...
J>
>Hello John,
You need to guard against unhandled exceptions by registering a
handler
for them.
Just add a ThreadExceptionEventHandler to the
Application.ThreadException
delegate
---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo
JWhat can I do to improve?
JJThanks
JJRegards
JJ"pvdg42" <pv****@newsgroups.nospamwrote in message
Jnews:uz**************@TK2MSFTNGP06.phx.gbl...
J>
>>>"John" <Jo**@nospam.infovis.co.ukwrote in message
news:OI****************@TK2MSFTNGP05.phx.gbl. ..
Hi
>
My vb.net winform app has frmMyForm as the start-up form. I have
enclosed My.Forms.frmMyForm.Show() within try/catch. Will this do
the trick of handling all exceptions that have not been handled
elsewhere?
>
Thanks
>
Regards
>
Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e
As
Microsoft.VisualBasic.ApplicationServices.Star tupEventArgs)
Handles
Me.Startup
Try
My.Forms.frmMyForm.Show()
Catch ex As Exception
' Exception handling here
End Try
End Sub
In terms of preventing the default exception handler from
terminating your app, I guess you could say it would work. In terms
of providing a context sensitive response to a given exception and
giving your application a chance to recover and continue, it's not
going to be useful.