Catching exceptions from another thread?

So you're using Invoke to marshall back to the UI thread, by the looks of it - which is exactly what you need to do. I'd personally use an Action for simplicity's sake, and possibly BeginInvoke instead of Invoke, but basically you're doing the right thing.

Thanks, I've never used Action before. Good suggestion. – Jeremy Oct 9 '08 at 21:01.

Use the BackgroundWorker class in the . NET framework instead. It is the best practice for performing UI work on a different thread.

Throwing exceptions between threads is not easy and probably not desired. Instead you can pass the exception using a shared data structure or variable and use waitHandle to wait on the 1st thread.

Probably a better way would be to pass a delegate into the thread instead of a reference to the form itself.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions