Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application.ThreadException is not thrown

Status
Not open for further replies.

jose74

Programmer
Feb 10, 2005
16
AT
Hi,

I try to catch all unmanaged exceptions in an application to send a bug report by webservice. So I implemented Application.ThreadException and AppDomain.UnhandledException. I also tried a try-catch-block at Application.Run(...). But the events are not fired.

I´m using VS 2005.

Can anybody help me?
 
I use some backgroundworker in the main form. When I delete them the events are fired, but I need some backgroundworker!

How can I use the ThreadExceptionHandler when I have a backgroundworker? The events are not fired althought the backgroundworker has finished!
 
ThreadException is for the current thread. A backgroundworker is running in a different thread. So if you set it at the start of your program, you'll also have to set it in each of your worker threads.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
I know this, but even if the backgroundworker has done the work, the ThreadException in the main thread is not captured.
 
Is the exception being thrown from the main thread?

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Hi Chiph!

Yes, the backgroundworker has finished and the exception is thrown in the main thread. But the threadexception is not captured.
 
Then I don't know, I'm sorry.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top