亲测:VC6的trace宏的输出查看



在对话框的按钮响应函数中输入如下代码:

void CTttDlg::OnButtonTrace()
{
// TODO: Add your control notification handler code here
// TRACE("123");
// TRACE("Hellow!%d",123456);


int x = 1;
int y = 16;
float z = 32.0;
TRACE( " \n This is a TRACE statement \n" );
TRACE( "The value of x is %d \n", x );
TRACE( "x = %d and y = %d \n", x, y );
TRACE( "x = %d and y = %d and z = %f ", x, y, z );

// AfxMessageBox("dd");
}


亲测:VC6的trace宏的输出查看
界面如图所示


 开启VC6的trace调试功能,默认是开启的,如下图。
亲测:VC6的trace宏的输出查看
 
亲测:VC6的trace宏的输出查看
 
按F5键:
亲测:VC6的trace宏的输出查看

终于看到trace输出了,呵呵。


其它:

 亲测:VC6的trace宏的输出查看
 亲测:VC6的trace宏的输出查看
 这个是不是影响,没试,我都这样试了。所以先这样附上。

这个是写在一个按钮响应函数中的,所以必须按一下按钮才输出。

试了一下,直接写在对话框的初始化BOOL CTttDlg::OnInitDialog(){TRACE( " \n 初始化对话框 \n" );}会直接输出来。
亲测:VC6的trace宏的输出查看
 
 亲测:VC6的trace宏的输出查看