Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-11-2003, 05:00 AM   #1
Registered: Jan 2003
Location: Midlands, England
Distribution: Mandrake 9.0, Slackware 8.1
Posts: 76

Rep: Reputation: 15
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?
Old 03-15-2003, 06:53 AM   #2
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
this is you would get more answers if you asked in a MFC forum.

try looking up CFile in MFC.
Old 03-16-2003, 02:58 AM   #3
LQ Newbie
Registered: Oct 2002
Location: New Zealand
Distribution: Redhat 9.0
Posts: 14

Rep: Reputation: 0
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


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.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
tomcat5 + shadow11 Linux - Enterprise 1 10-28-2005 07:26 PM
Win32/MFC porting toolkit? Artik Programming 3 08-09-2005 01:03 PM
Using MFC under WineLib rjlee Programming 0 01-12-2005 08:23 AM
MFC Coding Ameii83 Programming 3 12-22-2004 10:53 PM
MFC and GTKMM janiv Linux - Software 0 09-11-2003 05:57 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:48 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration