DEBUG_NEW,_DEBUG
来源:互联网 发布:淘宝自动评价 编辑:程序博客网 时间:2024/05/18 01:10
DEBUG_NEW
#define new DEBUG_NEW
说明:
帮助查找内存错误。用户在程序中使用DEBUG_NEW,用户通常使用new运算符来从堆上分配。在Debug模式下(但定义了一个DEBUG符号),DEBUG_NEW为它分配的每个对象记录文件名和行号。然后,在用户使用CMemoryState::DumpAllObjectSince成员函数时,每个以DEBUG_NEW分配的对象分配的地方显示出文件名和行号。 为了使用DEBUG_NEW,应在用户的资源文件中插入以下指令: #define new DEBUG_NEW 一旦用户插入本指令,预处理程序将在使用new的地方插入DEBUG_NEW,而MFC作其余的工作。但用户编译自己的程序的一个发行版时,DEBUG_NEW便进行简单的new操作,而且不产生文件名和行号消息。
#ifdef _DEBUG //如果定义了_DEBUG,也就是调试版程序,则执行以下三句
#define new DEBUG_NEW //定义new为DEBUG_NEW
#undef THIS_FILE //取消以前对THIS_FILE的定义
static char THIS_FILE[] = __FILE__; //声明并初始化THIS_FILEO数组,数据的初始数据为该文件的文件名
#endif
__FILE__ 就是当前源文件的名称
#define new DEBUG_NEW
说明:
帮助查找内存错误。用户在程序中使用DEBUG_NEW,用户通常使用new运算符来从堆上分配。在Debug模式下(但定义了一个DEBUG符号),DEBUG_NEW为它分配的每个对象记录文件名和行号。然后,在用户使用CMemoryState::DumpAllObjectSince成员函数时,每个以DEBUG_NEW分配的对象分配的地方显示出文件名和行号。 为了使用DEBUG_NEW,应在用户的资源文件中插入以下指令: #define new DEBUG_NEW 一旦用户插入本指令,预处理程序将在使用new的地方插入DEBUG_NEW,而MFC作其余的工作。但用户编译自己的程序的一个发行版时,DEBUG_NEW便进行简单的new操作,而且不产生文件名和行号消息。
#ifdef _DEBUG //如果定义了_DEBUG,也就是调试版程序,则执行以下三句
#define new DEBUG_NEW //定义new为DEBUG_NEW
#undef THIS_FILE //取消以前对THIS_FILE的定义
static char THIS_FILE[] = __FILE__; //声明并初始化THIS_FILEO数组,数据的初始数据为该文件的文件名
#endif
__FILE__ 就是当前源文件的名称
0 0
- DEBUG_NEW,_DEBUG
- #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE
- #ifdef _DEBUG #define new DEBUG_NEW #endif
- #ifdef _DEBUG #define new DEBUG_NEW #endif的解释
- #ifdef _DEBUG #define new DEBUG_NEW #endif的解释
- #ifdef _DEBUG #define new DEBUG_NEW #endif的解释
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW...
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW...
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW...
- #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif 语句解释
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif
- #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif
- #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif 语句解释
- DEBUG_NEW
- DEBUG_NEW
- debug_new
- DEBUG_NEW
- DEBUG_NEW
- JSP播放音乐
- 生活像一把无情的刻刀
- linux硬盘分区方案
- Linux设备驱动程序学习(10)-时间、延迟及延缓操作(Jiq.c)
- ios 面试题(1)
- DEBUG_NEW,_DEBUG
- java代码注释规范
- ADS
- C# Form Dispose 和 Close的区别
- Java字节流和字符流实例
- 回溯法解决n皇后问题
- IOS UIActivityIndicatorView、UIProgressView
- 设计随机产生的整数的类
- Linux设备驱动程序学习(7)-内核的数据类型