473,493 Members | 4,347 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Catching Exceptions central - is it possible?

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
Nov 15 '05 #1
5 2063
Check out this example on GotDotNet
http://samples.gotdotnet.com/quickst...FormsAppErrorH
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
"Hubert Hermanutz" <hh********@kavo.de> wrote in message
news:uE**************@TK2MSFTNGP12.phx.gbl...
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

Nov 15 '05 #2
Take a look at the Robbins book "Debugging Applications for .NET and
Windows"

On Mon, 8 Dec 2003 14:02:40 +0100, "Hubert Hermanutz"
<hh********@kavo.de> wrote:
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


Nov 16 '05 #3
Take a look at the Robbins book "Debugging Applications for .NET and
Windows"

On Mon, 8 Dec 2003 14:02:40 +0100, "Hubert Hermanutz"
<hh********@kavo.de> wrote:
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


Nov 16 '05 #4
Take a look at the Robbins book "Debugging Applications for .NET and
Windows"

On Mon, 8 Dec 2003 14:02:40 +0100, "Hubert Hermanutz"
<hh********@kavo.de> wrote:
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


Nov 16 '05 #5
Take a look at the Robbins book "Debugging Applications for .NET and
Windows"

On Mon, 8 Dec 2003 14:02:40 +0100, "Hubert Hermanutz"
<hh********@kavo.de> wrote:
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


Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2965
by: Rolf | last post by:
I understand a compilation error occurs when a method that throws no exceptions is the only code in a try block. What I don't understnad is why I can specify the catching of an Exception for a...
2
1744
by: Keith Bolton | last post by:
I am handling exceptions currently using try, except. Generally I don't handle specific exceptions and am catching all. Then if an exception occurs, I would like to capture that error string....
15
17970
by: Steven Reddie | last post by:
I understand that access violations aren't part of the standard C++ exception handling support. On Windows, a particular MSVC compiler option enables Microsoft's Structured Exception Handling...
4
1685
by: Laxmikant Rashinkar | last post by:
Hi, I am working with a program that someone else wrote. This program is full of bugs and unhandled exceptions are thrown all over the code. Instead of trying to catch the exception at each...
7
2311
by: cmay | last post by:
FxCop complains every time I catch System.Exception. I don't see the value in trying to catch every possible exception type (or even figuring out what exceptions can be caught) by a given block...
12
6086
by: Vasco Lohrenscheit | last post by:
Hi, I have a Problem with unmanaged exception. In the debug build it works fine to catch unmanaged c++ exceptions from other dlls with //managed code: try { //the form loads unmanaged dlls...
3
7289
by: Mike Binks | last post by:
I wish to make sure all unhandled exceptions (UE) are handled by a central handler. For primary thread UEs, this may be done by string exceptionText; ...
5
2209
by: Simon Tamman | last post by:
I have an object named DisasterRecovery. The Ctor of this object is this: private DisasterRecovery() { Application.ThreadException+= new...
5
3553
by: Paul Sijben | last post by:
All, in a worker thread setup that communicates via queues is it possible to catch exceptions raised by the worker executed, put them in an object and send them over the queue to another thread...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.