开发者

Are Cross-Thread exceptions less strict in Windows 7

I've been writing WinForms code that uses a BackgroundWorker to do some async work, and then update the UI when done; I'm using Windows 7. There have been a few cases where I've been careless, and accessed UI components on the child thread. For some reason this has worked fine, but only broken once someone else tested on Windows XP. And oddly eno开发者_如何学运维ugh, it also breaks on Windows 7 when the code is run through the debugger.

Can someone help me to understand what's going on here - other than the fact that I'm a sloppy, careless programmer :) ?

Are cross-thread exceptions handled differently on Windows 7 vis-a-vis Windows XP?


Generally, result of such operation is undefined. Set Control.CheckForIllegalCrossThreadCalls Property to true in the beginning of the program to get predictable failure on every cross-thread call.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜