控制台中就能正确输出到文件,在MFC程序中不行
求助,同样的代码在控制台中就能正确输出到文件,在MFC程序中就无法输出到文件,是什么原因?ACE_OSTREAM_TYPE *output = new std:fstream("c:\\log.txt");
ACE_LOG_MSG->msg_ostream(output,0);
ACE_LOG_MSG->set_flags(ACE_Log_Msg::OSTREAM);
ACE_DEBUG((LM_DEBUG,ACE_TEXT("%IThis will go to STDERR,")ACE_TEXT("syslog & an ostream\n")));
ACE_LOG_MSG->clr_flags(ACE_Log_Msg::OSTREAM);
delete output; ACE_LOG_MSG->priority_mask(LM_DEBUG|LM_ERROR|LM_INFO,ACE_Log_Msg:ROCESS);
ACE_LOG_MSG->priority_mask(LM_DEBUG|LM_ERROR|LM_INFO,ACE_Log_Msg::THREAD);
添加上就好了。
页:
[1]