控制台程序输入CTRL+C后弹出异常的原因
来源:互联网 发布:文件上传js代码 编辑:程序博客网 时间:2024/05/16 12:20
今天在写一个控制台程序。按照以前的经验,输入CTRL+C后,程序应该正常结束,
但是今天却每次都弹出一个异常提示框,“0x40010005: Control-C”。
排查了很长时间,终于找到原因了。
实际上这不是什么错误,只要在Debug模式下,输入CTRL+C或者CTRL+BREAK等命令
都会导致系统内部抛出一个异常;在非Debug模式下,系统内部不会抛出这个异常。
参考资料在这里:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682541(v=vs.85).aspx
The CTRL+C and CTRL+BREAK key combinations receive special handling by console processes. By default, when a console window has the keyboard focus, CTRL+C or CTRL+BREAK is treated as a signal (SIGINT or SIGBREAK) and not as keyboard input. By default, these signals are passed to all console processes that are attached to the console. (Detached processes are not affected.) The system creates a new thread in each client process to handle the event. The thread raises an exception if the process is being debugged. The debugger can handle the exception or continue with the exception unhandled.
- 控制台程序输入CTRL+C后弹出异常的原因
- 控制台程序Ctrl +C 退出
- 【讨论】控制台程序 Ctrl+C 异常问题 First-chance exception in ***.exe [Kernel32.dll].....
- Win32控制台程序,忽略Ctrl+C
- windows 控制台程序 响应 Ctrl+C
- windows 控制台程序 响应 Ctrl+C
- CTRL+C CTRL C不能用的原因 zz
- C# Win32控制台应用程序忽略 Ctrl + C,阻止程序退出
- 控制台程序的输入问题
- windows和linux下设置控制台CTRL+C等特殊按键的回调函数之后程序结束的过程
- Vs2008 win32控制台程序不弹出控制台窗口的方法
- ros执行ctrl+c后修改程序运行时间
- 使程序不在 Ctrl+Alt+Del 弹出的对话框内
- MFC程序中获得控制台的输入
- 控制台程序,输入退格键不回显的方法
- C++控制台程序判断输入的数字
- sublime运行python程序的控制台输入
- C语言中接受控制台的输入
- 用键盘在网页上选择复选框
- hdu 2525(模拟)
- 《一个操作系统的实现》(二):使用Bochs调试操作系统
- RAC 详解
- Eclipse @override报错
- 控制台程序输入CTRL+C后弹出异常的原因
- 2.View学习(Backbone Tutorials)
- 电阻和磁珠的区别
- 心痛
- ThinkPad T410i 安装 Mac10.8.3 记录
- RMAN Nocatalog 与Catalog 区别
- 25 Most Frequently Used Linux IPTables Rules Examples
- hibernate的many-to-one的级联删除问题
- 移动设计开发入门