PC Review


Reply
Thread Tools Rate Thread

Capture unhandled exceptions thrown by an MDI child form?

 
 
JWA
Guest
Posts: n/a
 
      11th Aug 2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Inheritance: Can master form handle all unhandled exceptions Maxwell2006 Microsoft Dot NET Framework Forms 0 6th Nov 2006 05:25 PM
Unhandled Exceptions thrown Winista Microsoft ASP .NET 0 22nd Mar 2006 08:02 PM
MDI Child Errors Crash Application - Unhandled Exceptions Sam Loveridge Microsoft VB .NET 5 21st Jul 2005 07:13 AM
Unhandled exception after calling child form's Dispose(). Vijayakrishna Pondala Microsoft Dot NET Framework Forms 1 17th Feb 2005 10:37 AM
Catching exceptions thrown by an MDI Child Form separately JWA Microsoft Dot NET Framework Forms 1 9th Aug 2004 11:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:02 PM.