(转)MFC中TRACE的用法

1.在MFC中加入TRACE语句

2.在TOOLS->MFC TRACER中选择 “ENABLE TRACING”点击OK

3.进行调试运行,GO(F5)(特别注意:不是执行‘!’以前之所以不能看到TRACE内容,是因为不是调试执行,而是‘!’了,切记,切记)

4.然后就会在OUTPUT中的DEBUG窗口中看到TRACE内容了,调试执行会自动从BUILD窗口跳到DEBUG窗口

#include <iostream>
#include <afxwin.h>

using namespace std;

int main(){
	cout<<("Hello 中国")<<endl;

	TRACE("hello中国\n");

	TRACE("v1=%d,f2=%.2f,s3=%s \n", 1,3.1415f,"中国");
	int i=10;
	i ++;
	getchar();
	return 0;
}

  

原文地址:https://www.cnblogs.com/wucg/p/2360286.html