LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 03-11-2003, 05:00 AM   #1
t1mc00per
Member
 
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
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
this is linuxquestions.org 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
jamestwok
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

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
 
  


Reply


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 + java.io.Serialization 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


All times are GMT -5. The time now is 01:18 PM.

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