C builder RAD 2010 RTL/VCL 应用程序 ->Terminate() 函数不终止应用程序
我这里也描述了一个问题: http://www.delphigroups.info/3/ 9/106748.html
我尝试了几乎所有形式的将 Application->Terminate() func 放置在代码中的任何位置,而不是“return 0”、“ExitProcess(0)”、“ExitThread(0)” ',退出(0)。没有工作变体会关闭应用程序。相反,Application->Terminate() 语句之后的代码正在运行。
我的应用程序中有两个或更多线程。我尝试在执行后创建的线程和主线程中调用终止函数。
此外,这与 CodeGuard / madExcept 无关(据我想象)(我已将其关闭并打开,没有效果)。 CodeGuard的转向也没有成功。
唯一有效的代码变体是将 Application->Terminate() 调用放置到任何表单按钮的 OnClick 处理程序中。但这不符合我的需求。我需要在任何地方终止。
我应该怎么做才能终止 C++ Builder 2010 应用程序中的所有线程,然后终止进程?
I have a problem also described here: http://www.delphigroups.info/3/9/106748.html
I have tried almost all forms of placing Application->Terminate() func everywhere in the code, following and not 'return 0', 'ExitProcess(0)', 'ExitThread(0)', exit(0). No working variant closes the app. Instead the code after Application->Terminate() statement is running.
I have two or more threads in the app. I tried calling terminate func in created after execution threads and in main thread.
Also this is not related (as far as I can imagine) with CodeGuard / madExcept (I have turned it off and on, no effect). CodeGuard turning also did not do success.
The only working code variant is to place Application->Terminate() call to any of any form button's OnClick handler. But this does not fit in my needs. I need to terminate in any place.
What I should do to terminate all the threads in C++ Builder 2010 application and then terminate the process?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应用程序->Terminate() 不会立即关闭应用程序,它仅表明您要关闭应用程序。
在您的函数中调用 Application->ProcessMessages() 然后检查应用程序->终止 属性为 true。
例如:
Application->Terminate() does not close application immediately, it only signals you want to close the application.
In your functions call Application->ProcessMessages() then check if the Application->Terminated property is true.
For example: