Guskz Kz
2015-06-21 14:32:08 UTC
Instead of 0 carriage return 0, I get 00 in the text file below, what is wrong???
*************************
CString pBuffer;
DWORD ptext = 0;
ClientFile.Format(_T("Textfile.txt"));
if (!p_file.GetStatus(ClientFile, status))
!p_file.Open(ClientFile, CFile::modeCreate | CFile::modeReadWrite);
else if (!p_file.Open(ClientFile, CFile::modeReadWrite))
MessageBox(NULL, (LPCWSTR) "Can't open file", (LPCWSTR) "file", MB_OK);
pbuffer.Format(_T("%1u\r\n"), ptext);
p_file.SeekToEnd();
p_file.Write(pbuffer, pbuffer.GetLength());
p_file.SeekToEnd();
p_file.Write(pbuffer, pbuffer.GetLength());
p_file.Close();
*************************
CString pBuffer;
DWORD ptext = 0;
ClientFile.Format(_T("Textfile.txt"));
if (!p_file.GetStatus(ClientFile, status))
!p_file.Open(ClientFile, CFile::modeCreate | CFile::modeReadWrite);
else if (!p_file.Open(ClientFile, CFile::modeReadWrite))
MessageBox(NULL, (LPCWSTR) "Can't open file", (LPCWSTR) "file", MB_OK);
pbuffer.Format(_T("%1u\r\n"), ptext);
p_file.SeekToEnd();
p_file.Write(pbuffer, pbuffer.GetLength());
p_file.SeekToEnd();
p_file.Write(pbuffer, pbuffer.GetLength());
p_file.Close();