在程序 debug 版本中 
TRACE("kkkkk");
单步调试发现输出的是 
工程名:kkkkk就是说 自动加了个工程名上去  这是为什么 ?

解决方案 »

  1.   

    你是不是上面有TRACE工程名的地方,而且没有换行啊。呵呵
      

  2.   

    没有啊 
    我试验
    TRACE("1\n");
    TRACE("2\n");
    TRACE("3\n");
    输出结果就变成
    MyPro: 1
    MyPro: 2
    MyPro: 3
      

  3.   

    无论怎样 TRACE("%d  %s ", ....) ;  都是自动在输出语句前加上 工程名。 现在用ide创建新的工程也是一样 。 工程名是 tt 
    TRACE("ggg");  输出 tt: ggg  
    晕倒了
      

  4.   

    调试进 TRACE 发现
    if ((afxTraceFlags & traceMultiApp) && (AfxGetApp() != NULL))
    afxDump << AfxGetApp()->m_pszExeName << ": ";
    这里输出了 那个工程名 
      

  5.   

    int afxTraceFlags;ResUsed to turn on the built-in reporting features of the Microsoft Foundation Class Library.This variable can be set under program control or while using the debugger. Each bit of afxTraceFlags selects a trace reporting option. You can turn any one of these bits on or off as desired using TRACER.EXE. There is never a need to set these flags manually. The following is a list of the bit patterns and the resulting trace report option: 0x01   Multiapplication debugging. This will prefix each TRACE output with the name of the application and affects both the explicit TRACE output of your program as well as the additional report options described below.How to Turn on TRACE OutputBy default TRACE message output is disabled. In order for trace output to be seen, you must perform the following steps: Compile your program with the _DEBUG symbol defined and link with a debug version of the MFC library. Debugging and trace options are only available in the _DEBUG version of the library.
    Enable the afxTraceEnabled flag. There are several ways to do this, but using theTRACER.EXE utility is highly recommended.
    Customize the afxTraceFlags to the level of detail you would like to see in trace messages. Use of the TRACER.EXE utility is highly recommended. 
    Where the Output Goes
      

  6.   

    搞定了 在Tools --》 MFC Tracer 菜单下   Multiple Application Debug  去掉勾就是了
      

  7.   

    改变“Tools——》MFC Tracer”上的选择