Hi.
I'm trying to read a file, search for a particular string, and then replace it with something else. I can easily read and search, but the writting part do not work and I don't understand. As a new C++ programer, I need help !
Here's the code I was roughly using:
void ReadWrite()
{
CStdioFile vFile;
CString line;
vFile.Open ("Test.ini", CFile::modeCreate | CFile::modeNoTruncate | CFile::modeReadWrite);
while (vFile.ReadString (line))
{
if (line=="DesiredText" vFile.WriteString ("New text"
}
vFile.Close ();
}
Thanks
I'm trying to read a file, search for a particular string, and then replace it with something else. I can easily read and search, but the writting part do not work and I don't understand. As a new C++ programer, I need help !
Here's the code I was roughly using:
void ReadWrite()
{
CStdioFile vFile;
CString line;
vFile.Open ("Test.ini", CFile::modeCreate | CFile::modeNoTruncate | CFile::modeReadWrite);
while (vFile.ReadString (line))
{
if (line=="DesiredText" vFile.WriteString ("New text"
}
vFile.Close ();
}
Thanks