473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Creating an error handler for my application

Hi all,

i'm trying to write an exception handler for my application, so in case an
exception occurs anywhere in my application, the exception has to be
catched.

At this moment i'm doing it via the following code:
Application.ThreadException += new
System.Threading.ThreadExceptionEventHandler(Appli cation_ThreadException);

But this doesn't work for me. If an exception is being thrown, it isn't
catched by the ThreadException event and a exception is being displayed.

Could someone please help me with this problem?

Thanks in advance,

Mathieu
Nov 17 '05 #1
2 1331
There's also an UnhandledException event on the AppDomain, try handling that
too.

"Mathieu Brüning" <ma************@kabelfoon.nl> wrote in message
news:43***********************@news.kabelfoon.nl.. .
Hi all,

i'm trying to write an exception handler for my application, so in case an
exception occurs anywhere in my application, the exception has to be
catched.

At this moment i'm doing it via the following code:
Application.ThreadException += new
System.Threading.ThreadExceptionEventHandler(Appli cation_ThreadException);

But this doesn't work for me. If an exception is being thrown, it isn't
catched by the ThreadException event and a exception is being displayed.

Could someone please help me with this problem?

Thanks in advance,

Mathieu

Nov 17 '05 #2
Mathieu,

The ThreadException event on the Application class is only fired for
exceptions that take place on the main UI thread. If the exception occurs
on a thread other than the main UI thread, you need to use the app domain
unhandled exception handler.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mathieu Brüning" <ma************@kabelfoon.nl> wrote in message
news:43***********************@news.kabelfoon.nl.. .
Hi all,

i'm trying to write an exception handler for my application, so in case an
exception occurs anywhere in my application, the exception has to be
catched.

At this moment i'm doing it via the following code:
Application.ThreadException += new
System.Threading.ThreadExceptionEventHandler(Appli cation_ThreadException);

But this doesn't work for me. If an exception is being thrown, it isn't
catched by the ThreadException event and a exception is being displayed.

Could someone please help me with this problem?

Thanks in advance,

Mathieu

Nov 17 '05 #3

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

Similar topics

4
by: Altramagnus | last post by:
I have 30 - 40 type of different window. For each type I need about 20 instances of the window. When I try to create them, I get "Error creating window handle" My guess is there is a maximum...
0
by: helpful sql | last post by:
Hi all, I am getting an exception from asp.net application that says error creating section handler. Here is my configuration section from web.config file: <configSections> <section...
6
by: DraguVaso | last post by:
Hi, In my application, on some given actions while debugging in Visual Studio, I suddenly get a "System.ComponentModel.Win32Exception was unhandled" Message="Error creating window handle."...
17
by: Ange T | last post by:
Hi there, I'm having pain with the VB behind an Access form. The form is used to create reports in Excel based on the details entered in the form. This has always worked without error on my...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
0
by: thehitman | last post by:
I used an article "Creating a Flexible Configuration Section Handler "(http://www.15seconds.com/issue/040504.htm). The Console application works with app.config but with the web.config. The...
17
Motoma
by: Motoma | last post by:
This article is cross posted from my personal blog. You can find the original article, in all its splendor, at http://motomastyle.com/creating-a-mysql-data-abstraction-layer-in-php/. Introduction:...
4
by: jdokos | last post by:
Hello All, I have a procedure that is getting -443 after upgrading to V9.5 FP1. The procedure was written to output only the SQLCODE. Here is the output that is returned: Value of output...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.