且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

执行Windows应用程序时,它显示错误“已停止工作”。

更新时间:2021-11-16 22:28:54





只要应用程序正在处理后台步骤,就会显示应用程序已停止工作。



我只能猜测,但是因为你正在加载图表我建议加载图表在GUI线程中完成并阻止线程发送心跳到.Net引擎,随后将应用程序视为未响应,并将应用程序报告为已停止工作到Windows,然后显示该消息。另一个原因可能是应用程序在代码中的某个地方陷入无限循环。



作为解决方案,您可以等到已停止工作 - 消息消失(它将在应用程序完成所有图表计算工作并且没有陷入无限循环之后)或重写应用程序以便在单独的线程中加载所有图表(在Google上搜索'VB.Net多线程 .com)。



欢呼

Marco
Hi,

the Application has stopped working is shown whenever an application is processing background steps.

I can only guess, but since you are loading charts I suggest that the loading of the charts is done in the GUI thread and blocks the thread from sending a heartbeat to the .Net engine, which followingly sees the application as "Not responding" and reports the app as "has stopped working" to windows, which afterwards displays the message. Another cause may be that the app is caught up in an endless loop somewhere in the code.

As solution, you can either wait until the "has stopped working"-message disappears (it will, after the app has done all the chart calc work and is not caught in an endless loop) or rewrite the app that all charts are loaded in a separate thread (Search for ''VB.Net multithreading" on Google.com).

cheers
Marco