|
|
我建一个项目有3个文件 D2D.CPP,D2DLIB.CPP,D2DLIB.H
其中D2DLIB.H里为了调试加了这样一段代码:
#if defined(OPTIONAL_DEBUG_ON)
#pragma message("open the debug option...")
extern FILE * fp =NULL;
#define OPENLOG(filename) {if(NULL==(fp=fopen(filename,"w+"))) return(0);}
#define LOGINFILE_PTR fp
#define WRITELOG fprintf
#define CLOSELOG() fclose(fp); #define OUTMSG(caption,content,style) (MessageBoxEx(NULL,caption,content,style,0);)
#else
#pragma message("close the debug option")
#define OPENLOG(filename)
#define WRITELOG /##/
#define CLOSELOG()
#define OUTMSG(caption,content,style)
#endif
main 函数在D2D.CPP里,D2DLIB.CPP里没有启动函数,请问我怎么设置OPTIONAL_DEBUG_ON标志使D2D.CPP和D2DLIB.CPP里的函数同时可以进入调试状态?
谢谢了哦!~ |
|