MFC如何把CString写入文本文件?
CStdioFilef;wchar_tfPath[64];wsprintf(fPath,L"%s*",L"\\Harddisk\\error.txt");f.Open(f...
CStdioFile f; wchar_t fPath[64]; wsprintf(fPath, L"%s*", L"\\Harddisk\\error.txt"); f.Open(fPath,CFile::modeCreate | CFile::modeReadWrite); ::SYSTEMTIME systime; ::GetSystemTime(&systime); CString s; s.Format(L"%d-%d-%d %d:%d:%d",systime.wYear,systime.wMonth,systime.wDay,systime.wHour,systime.wMinute,systime.wSecond); //f.Seek(0,CFile::end); //不注释掉这里,就在这里报错 f.WriteString(s); //现在在这里出错,调试的话直接进filecore.c里去了 f.Close();请问应该怎么处理?
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询