初学VC不好意思,问一下。

解决方案 »

  1.   

    是在debug时在你的输出窗口输出你要输出的调试信息的,在release下无效,分别有TRACE0,TRACE1,TRACE2..,参考MSDN
      

  2.   

    调试时在Debug窗口输出自定义内容的
    如TRACE("test\n");
    使用它先在Tools->mfc tracer里给Enable tracing打勾
      

  3.   

    记录用的, 输出窗口看结果。TRACE
    TRACE1
    TRACE2
    TRACE3...都是这系列的,因为macro不能重载嘛。:)
      

  4.   

    http://blog.csdn.net/enochshen/archive/2005/02/19/294164.aspx
      

  5.   

    其实对开发人员没有太大的意思,就想C语言一样,看看输出的结果
    是不是想要的,其实VC提供的调试手段比这好多了
      

  6.   

    // example for TRACE
    int i = 1;
    char sz[] = "one";
    TRACE( "Integer = %d, String = %s\n", i, sz );
    // Output: 'Integer = 1, String = one'// another example for TRACE
    // Note that the TRACE() macro accepts a LPCTSTR for the format string
    // parameter, while the other TRACEn() macros accept a LPCSTR.
    // This means that you should use the _T() macro on formatting strings 
    // you supply if you want to build both _UNICODE and non-_UNICODE from
    // the same source.TRACE(_T("Hockey is best!\n"));// remember to include <stdlib.h> to get rand() and its friendsint nCount = rand();
    TRACE(_T("There are %d fans at this moment.\n"), nCount);
      

  7.   

    这个可以针对多线程程序调试使用,多线程情况下其它的debug方法不太方便。
      

  8.   

    用TRACE查看调试不爽,不过它在编译的时候不用一个一个的去删也不错。