VC中可以自定义编译输出消息
2012-10-30 17:55
120 查看
转自【/article/1415716.html】
#pragma message("Insert User-defined Information here!")
但是这样没有文件和行数信息,不能定位。
使用如下方式可以定位:
[cpp]
view plaincopyprint?
// put the following code in header file or at the beginning of the source file.
#define __STR2__(x) #x
#define __STR1__(x) __STR2__(x)
#define __LOC__ __FILE__ "("__STR1__(__LINE__)") : Warning Msg: "
// output the user-define information in the source file.
#pragma message(__LOC__"User-defined Information")
参考:http://support.microsoft.com/kb/155196/en-us
#pragma message("Insert User-defined Information here!")
但是这样没有文件和行数信息,不能定位。
使用如下方式可以定位:
[cpp]
view plaincopyprint?
// put the following code in header file or at the beginning of the source file.
#define __STR2__(x) #x
#define __STR1__(x) __STR2__(x)
#define __LOC__ __FILE__ "("__STR1__(__LINE__)") : Warning Msg: "
// output the user-define information in the source file.
#pragma message(__LOC__"User-defined Information")
// put the following code in header file or at the beginning of the source file. #define __STR2__(x) #x #define __STR1__(x) __STR2__(x) #define __LOC__ __FILE__ "("__STR1__(__LINE__)") : Warning Msg: " // output the user-define information in the source file. #pragma message(__LOC__"User-defined Information")
参考:http://support.microsoft.com/kb/155196/en-us
相关文章推荐
- vc中自定义编译时的输出消息 .
- vc中自定义编译时的输出消息
- OMNeT++中自定义消息在VC中的编译方法
- VC自定义消息ON_MESSAGE的编译错误error C2440
- 在VC中自定义一个消息,并利用该消息弹出一个对话框
- TRACE宏(只在MFC的DEBUG中有效)|VC++非MFC项目中如何自定义TRACE宏|头文件的重复编译|DEBUGVIEW窗口
- VC对话框项目-自定义消息的方法
- vc自定义消息的发送与接收的方法实现
- VC++中自定义消息四步走完
- 利用消息机制实现VC与Delphi之间的通讯(发送自定义消息)
- 用vc2010以上版本编译可以在低版本xp和2003的运行程序的方法
- delphi7 ide扩展,类似vc6,通过编译指令控制多项目工程编译输出
- 用自定义消息在线程间通信(VC)
- VC中用户自定义消息
- vc自定义消息的发送与接收的方法实现
- VC中的自定义消息
- VC中自定义消息实现
- keil中自定义输出信息到编译窗口
- VC 自定义消息 postmessage用法
- 在VC下手工为对话框添加自定义消息