Windows中的Paint事件中的异常和访问冲突 [英] Exceptions and Access Violations in Paint events in Windows

查看:220
本文介绍了Windows中的Paint事件中的异常和访问冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行一些新代码后,我的C ++应用程序开始表现出奇怪的(屏幕更新不正确或不完整,有时没有屏幕更新)。
一段时间后,我们发现新代码导致访问冲突。奇怪的是,应用程序只是继续运行(但是屏幕更新不正确)。

After executing some new code, my C++ application started to behave strange (incorrect or incomplete screen updates, sometimes no screen updates at all). After a while we found out that the new code is causing an Access Violation. Strange enough, the application simply keeps on running (but with the incorrect screen updates).

最初我们认为问题是由try-catch 。)构造(由一个过度活跃的同事放在那里),但几个小时后(仔细检查调用堆栈,添加许多断点,...)我们发现如果在paint事件中有一个访问冲突,Windows捕获

At first we thought the problem was caused by a "try-catch(...)" construction (put there by an overactive ex-colleague), but several hours later (carefully inspecting the call stacks, adding many breakpoints, ...) we found out that if there's an Access Violation in a paint event, Windows catches it, and simply continues running the application.


  • 这是正常的行为吗?

  • 是正常的吗? Windows在绘画事件期间捕获异常/错误?

  • 有没有办法禁用这个? (如果不是,这意味着我们必须在调试器中运行所有的异常,同时测试我们的代码)。


  • 在XP上正确崩溃(违反访问行为后的行为)

  • and the Windows 7 the application keeping on running

推荐答案

这是一个已知的缺陷。检查修补程序。 http://support.microsoft.com/kb/976038

It's a known defect. Check the hotfix. http://support.microsoft.com/kb/976038

这篇关于Windows中的Paint事件中的异常和访问冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆