在程序初始化的时候加入以下代码即可:

 SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
    _set_abort_behavior(0,_WRITE_ABORT_MSG);

这样程序就悄无声息的崩溃了,不然守护进程都不起作用。如果不这样做,弹出错误对话框程序如果不点击关闭或发送错误报告就僵死在那里了,守护进程一直发现进程没挂,就不重启。

 

references:

http://blog.163.com/danshiming@126/blog/static/10941274820154763227578/

https://stackoverflow.com/questions/9718695/how-can-i-supress-all-error-dialogs-when-a-process-crashes-i-only-want-it-to-cr

https://stackoverflow.com/questions/1861506/prevent-modal-dialog-on-win32-process-crash

 

相关文章:

  • 2021-08-17
  • 2021-12-10
  • 2022-12-23
  • 2022-01-18
  • 2021-12-10
  • 2021-10-29
  • 2021-07-30
猜你喜欢
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2021-12-10
  • 2021-06-30
相关资源
相似解决方案