Writing to flat text file w/o serialization
Im trying to write some data to a text file. The text file would contain the logs & various data. Am using ofstream & whenever I write any datatype CString or LONG or anything, it writes in serialised form i guess.
I try to write as: tofile<<strValue;
But this is written to the file as some junk value. I want the text file to be readable when opened in notepad. I dont want to open the file from the application, and read those value, hence dont need serialization. How do i do?
Re: Writing to flat text file w/o serialization
Hi,
In your case, why do u need serialization ? You can just remove that code
and use CFile or CStdioFile to write and read your data directly. :)
Re: Writing to flat text file w/o serialization
Hi,
Alternatively, you can use CArchive::WriteString. Take a look at http://msdn2.microsoft.com/en-us/library/0ck300ac.aspx
for a sample.
Re: Writing to flat text file w/o serialization