如何让写入log文件中的数据是一行一行的(急)
我要写入的信息是CString类型的,
HANDLE hFile;
hFile = CreateFile(strName, // open MYFILE.TXT
GENERIC_READ|GENERIC_WRITE , // open for reading
FILE_SHARE_READ, // share for reading
NULL, // no security
//OPEN_EXISTING, // existing file only
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL, // normal file
NULL); // no attr. template
if (hFile == INVALID_HANDLE_VALUE)
{
MessageBox("Could not open file.",MSGTitle001,MB_OK|MB_ICONINFORMATION); // process error
}
CFile myFile((int)hFile);
CArchive arStore(&myFile, CArchive::store);
myFile.SeekToEnd( );
for(int i = 0; i < m_arrTaskItemInfo.GetSize (); i ++)
{
arStore.WriteString( _T("asdfdsfdf "));
}
arStore.WriteString( "\n" );
// Close the storing archive
arStore.Close();
CloseHandle(hFile);
内容写进入了,都在一行,希望是一行一行的,如何实现呀,我写入类型一定是CString类型的