|
-
August 4th, 2006, 01:20 AM
#1
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?
-
August 4th, 2006, 01:26 AM
#2
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.
-
August 4th, 2006, 01:27 AM
#3
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.
-
August 4th, 2006, 01:41 AM
#4
Re: Writing to flat text file w/o serialization
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|