J
JWA
Hi All,
How can you capture unhandled exceptions thrown by an MDI child form
separate from the entire app?
I have an application-wide exception handler to catch crashes by doing
the following in my Application entry point:
Public Shared Sub Main()
'Explicitly set apartment state to Single Thread Apartment (STA)
System.Threading.Thread.CurrentThread.ApartmentState =
System.Threading.ApartmentState.STA
Dim eh As New MyExceptionHandler()
AddHandler Application.ThreadException, AddressOf
eh.OnThreadException
Application.Run(New Form1)
End Sub
The form that I'm using to handle this reports/logs the exception and
closes down the application. This works perfectly. I now want to enhance
this functionality by catching unhandled exceptions within individual
MDI Child forms so that I can close down just the child form and not the
entire app. I'm having trouble isolating the exceptions thrown by the
child forms separately. Does anyone have any tips on how best to do this?
Thanks,
--Josh
How can you capture unhandled exceptions thrown by an MDI child form
separate from the entire app?
I have an application-wide exception handler to catch crashes by doing
the following in my Application entry point:
Public Shared Sub Main()
'Explicitly set apartment state to Single Thread Apartment (STA)
System.Threading.Thread.CurrentThread.ApartmentState =
System.Threading.ApartmentState.STA
Dim eh As New MyExceptionHandler()
AddHandler Application.ThreadException, AddressOf
eh.OnThreadException
Application.Run(New Form1)
End Sub
The form that I'm using to handle this reports/logs the exception and
closes down the application. This works perfectly. I now want to enhance
this functionality by catching unhandled exceptions within individual
MDI Child forms so that I can close down just the child form and not the
entire app. I'm having trouble isolating the exceptions thrown by the
child forms separately. Does anyone have any tips on how best to do this?
Thanks,
--Josh