Catching Exceptions central - is it possible?

  • Thread starter Hubert Hermanutz
  • Start date
H

Hubert Hermanutz

Hi,

as yet i have readed in the MSDN about exception handling. The only
references that i was founded, described try, catch, finally and throw
objects.

But I am searching about an occation to catch exceptions central, maybe, the
framework call a central function of each class, when there is throw a
exception. The reason is, that i do not need try, catch... blocks and
therefore the sourcecode will be going to unreadable.

Do exist an solution?

Thanks in advance,
Hubert
 
J

Jan Tielens

Check out this example on GotDotNet
http://samples.gotdotnet.com/quickstart/howto/doc/WinForms/WinFormsAppErrorH
andler.aspx
In your application design you might want to register an exception handler
for any exceptions you have not handled in your application. You can create
an exception handler for your unhandled exceptions by calling the
Application.AddOnThreadException method and passing in a reference to a
method in your application. This method will then be called for any
unhandled exceptions on that thread. The OnThreadException event is raised
when the Windows Forms window procedure receives an exception.

Windows Forms provides a default exception handler and exception handling
dialog named ThreadExceptionDialog. This dialog can be used during
development, but you will want to supply your own custom exception handlers
for your application when it is near completion.


--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
J

Jason Guarracino

Take a look at the Robbins book "Debugging Applications for .NET and
Windows"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top