從簡單調試著手VC

 

一直用BCB 做開發,應上面要求用VC開發程式,剛用VC,有太多的地方不懂.

先從調試著手吧.                   

                          

1.   ALT+F7: C/C++ àCategory àGeneral;Link àGeneral àdebug info 勾上.

2.   設置斷點:F9 à彈出 breakpoints dialog box (ctrl+B or alt+F9) àF9(取消斷點) conditions button àbreakpoints àdate page à設置斷點 dialog box.

3.   watch:查看变量,表达式,内存的值;右击光标处àQuick Watch.memory:show memory content.varibles: 显示上下文可见的变量 (red.). 寄存器:显示所有当前寄存器的值.

4.   进程控制:F5:Go on run.F10: single step run,enter child function.F11: single step run,don’t enter child function.ctrl+F10:run to 当前光标.

5.   注意:检查是有返回值的function;通过异常机制抛出错误;处理错误代码;尽量在低层处理错误,不能处理的应提示用户注意;加上stdafx.h是预处理头文件,此文件作用是:加快编译速度,设置过程如下,project setting àc/c++ à category à preconpilation Header à select don’t use stdafx.h.

先寫到這裡,以後有許多不懂的地方,還得請教大家.

posted @ 2008-07-23 21:21  quzhixun  阅读(201)  评论(0编辑  收藏  举报