应用程序已停止Windows 7中的响应错误 [英] Application has stopped responding error in Windows 7

查看:113
本文介绍了应用程序已停止Windows 7中的响应错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户端,大多数情况下我的应用无法使用该客户端.该应用程序加载了视频缩略图,并给出了一个应用程序已停止响应''的错误并关闭了该应用程序.我认为问题在于他们的病毒扫描程序正在扫描我的视频文件,并且花费的时间太长.如果我将视频数量从19个减少到6个,则每次都可以正常运行.我测试过的所有其他Weven机器都没有问题.我的问题是,例如,我可以在清单中添加一些内容,以使Windows给我的程序更多的时间进行响应吗?

约翰-这是一个很好的建议,只有一个缺点.我的代码只是从文件系统加载文件列表.立即加载.当我的UI将WPF ListBox绑定到视频名称列表时,这似乎是调用病毒扫描程序的速度较慢的位.因此,加载视频不是我的代码,而且我不确定是否可以在另一个线程中执行.

解决方案

<您正在看到的消息是由任务管理器生成的.它定期用系统消息轮询每个正在运行的应用程序.如果应用程序在5秒钟内未响应该消息,则任务管理器认为它已冻结,并生成该消息.如果还没有,我会将缩略图加载代码放到后台线程中,以便UI可以响应系统消息.

问题的根源在于,用于加载缩略图的代码不是异步的,因此不允许应用程序响应其他消息.


哦,那么WPF是你的问题. :)


如果仅一次读取该列表,则我将尝试完全不使用数据绑定,只需执行

listbox.Items.AddRange(myList.ToArray());



当然,我不熟悉您的代码,但是值得一试.


I have one client for whom my app does not work most of the time. The application loads video thumbnails, and gives an application has stopped responding'' error and the app closes. I believe the issue to be that their virus scanner is scanning my video files and takes too long to do it. If I drop the number of videos from 19 to 6, it works fine every time. Every other Weven machine I''ve tested never has an issue. My question is, is there something I can put in the manifest, for example, to cause Windows to give my program more time to respond ?

John - that is an excellent suggestion with only one drawback. My code just loads the list of files from the file system. It loads in no time. The slow bit, the bit which seems to invoke the virus scanner, is when my UI binds a WPF ListBox to the list of video names. As such, it''s not my code that loads the videos, and I''m not sure that it''s possible to do it in another thread.

解决方案

The message you''re seeing is being generated by the Task Manager. It periodically polls every running application with a system message. If the application doesn''t respond to the message within 5 seconds, Task Manager thinks it''s froze up, and generates that message. If you haven''t already, I would put the thumbnail loading code into a background thread so that the UI can respond to the system message.

The root of the problem is that the code you use to load the thumbnail is not asynchronous, and therefore doesn''t allow the application to respond to other messages.


Oh, then WPF is your problem. :)


If the list is only read in one time, I''d try not using databinding at all, and simply do

listbox.Items.AddRange(myList.ToArray());



Of course, I''m not familiar with your code, but it might be worth a try.


这篇关于应用程序已停止Windows 7中的响应错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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