The use method of afxDump and TRACE
来源:互联网 发布:华为交换机给端口命名 编辑:程序博客网 时间:2024/06/02 16:32
#ifdef_DEBUG
afxDump<<"DumpingmyPerson:/n";
myPerson->Dump(afxDump);
afxDump<<"/n";
#endif
1)TRACE();/TRACE0();/TRACE1();/TRACE2();/TRACE3();:其用法和C中的printf()函数类似;TRACEn()和TRACE()的区别是前者使用的资源较少,前者中n表示所带参数的个数。使得TRACE可用:Tools-MFCTracer-Enablingtrace。
2)AfxDump();//其用法和C++中的cout类似;
3)AfxDump(constCobject*obj);会输出obj的相关信息(属性的值)。
4)MessageBox();/AfxMessageBox();
#ifdef_DEBUG
afxDump<<x;
#endif
将结果显示在OutPut,不能在Release状态下。Ctrl+F5似乎无效,F5可以。
afxDump.SetDepth(1);
设置深度,如maps,arrays,它只打出有几个可元素,我们用上面的这个函数,它会将所有的内容打出来.
#ifdef_DEBUG
chartest[]="0123456789/n";
afxDump.HexDump("--",(BYTE*)test,11,6);
#endif
结果为:
--303132333435
-
第一个参数,行首的打头字符.
第二个参数,要打的内容.
第三个参数,要打的元素个数.
第四个参数,每行的个数.
4,TRACE(...),TRACE0,TRACE1,TRACE2,TRACE3也只能在调试时用注意打字符串时有长度限制,包括结束符在内,不超过512个字符.
5.在Debug状态下
F9设置断点后,F5到下一个断点,F10下一行,F11进入函数(包括系统函数)内部,Shift+F11出来.
F5后,Debug菜单有相应的菜单项.
F5后,View->DebugWindow的子菜单项比较有用.
Watch查看你指定的变量
variables显示auot变量,local变量,this的值
memory显示指定内存地址存储的值
callstack显示函数调用关系
registers寄存器的值
Disabblemble汇编代码
其实Release下也可调试F5
Alt+f7工程设置
c/c++GenerateBrowseinfo选上.
Debuginfo选Progamedatabaseforeditandcontinue
LinkGeneratedebuginfo选上
Linkincrementally选上
- The use method of afxDump and TRACE
- The use method of Transation
- afxDump,TRACE,TRACE0
- The difference of typeof and GetType method
- Use Microsofe log method and deploy the web.config file
- The comparison of the toString() method and the valueOf(...) method of the String class
- The method of getChildHtml
- The use of cookies
- The use of Locale
- The use of MD_STOCK_REQUIREMENTS_LIST_API
- The use of NSBundle!
- the use of mmap
- The use of functions
- The use of functions
- #146 – Use GetValueSource Method to Find the Source of a Dependency Property Value
- gem5: the trace of cache set and cache line write hit counters
- use xmlhttp's getResponseHeader and setRequestHeader method
- JAVA Some Simple Class And Method Use.
- 很久没上CSDN了,变化好大
- NEAR and FAR pointer
- 我们这个国家还有什么是安全的
- 总觉得股市要起大变化!
- FxJob、FxAsk和FxFriend已经支持uc接口
- The use method of afxDump and TRACE
- 设置背景色
- 内核升级综合谈
- 建立yum服务器
- 计算机杂志投稿CSCD库指南
- 关于SQL的执行计划
- ASP.NET中Session的状态保持方式浅议
- 用C语言技术进行CGI程序设计
- 关于dwr学习(转)