catching exceptions from another thread

后端 未结 5 1411
名媛妹妹
名媛妹妹 2020-12-13 21:38

I have a method running in a seperate thread. The thread is created and started from a form in a windows application. If an exception is thrown from inside the thread, wha

5条回答
  •  眼角桃花
    2020-12-13 22:07

    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.

提交回复
热议问题