YKQ
August 17th, 1999, 10:36 PM
Hello:
I use VC++6.0 MFC.I want to open and read a file,and then
open and write to a file like this:
void CCodeChange1Dlg::ChangeCode()
{
CString str,str2;
CStdioFile Fillnput1(m_InputName,CFile::modeRead);
CFile fillnput2(m_OutputName,CFile::modeWrite|CFile::modeCreate);
fillnput1.ReadString(str);
str2.Format("%s\r\n",str);
fillnput2.Write((char*)(LPCTSTR)str2,str2.GetLength());
}
This is example the file char only one line.But when i test
the str2 can't read into file.Which is wrong?
Welcome any advice!
Thanks!
I use VC++6.0 MFC.I want to open and read a file,and then
open and write to a file like this:
void CCodeChange1Dlg::ChangeCode()
{
CString str,str2;
CStdioFile Fillnput1(m_InputName,CFile::modeRead);
CFile fillnput2(m_OutputName,CFile::modeWrite|CFile::modeCreate);
fillnput1.ReadString(str);
str2.Format("%s\r\n",str);
fillnput2.Write((char*)(LPCTSTR)str2,str2.GetLength());
}
This is example the file char only one line.But when i test
the str2 can't read into file.Which is wrong?
Welcome any advice!
Thanks!