MFC file serialization
I am attempting to write a music manuscript writer using Visual C++ and MFC. At the moment I just want the program to read in a text file, and depending on what character is read, output some text to the screen.
I've got the outputting to screen sorted with the OnDraw() function of my View class, but how would I go about reading in a text file? Is using Serialize() the best way, or is there a simpler way considering I only want to read in a text file and process it? |
this is linuxquestions.org you would get more answers if you asked in a MFC forum.
try looking up CFile in MFC. |
I really wouldn't bother with serialization. Its main use is for restoring an object to a saved state. You are much better off learning either how to use C++ OS streams - which I never can be bothered to do, or how to use the standard ANSI C file io routines which are very straight forward: these are
fopen fprintf fscanf fclose If you want to stick with MFC routines, then CStdioFile is the class to use for text files - it's basically a wrapper around CFile. James |
All times are GMT -5. The time now is 12:01 AM. |