CFile log_file;
int log_file_opened = 0;
void logMessage(const char * sMsg)
{
if(!log_file_opened)
{
log_file.Open("D:\\tex.log", CFile::modeCreate|CFile::modeWrite);
log_file_opened = 1;
}
int len = strlen(sMsg);
log_file.Write(sMsg, len);
}
转载于:https://www.cnblogs.com/SunkingYang/p/11049092.html