Saving Data to File
-
I am currently doing an application and i am required to save data from edit boxes to a file and load them when need. I am familiar with the C++ , FILE *fp method of file i/o. But is there a proper and simple MFC method for doing file i/o ? (Sample code greatly appreciated =) ) Thanks
-
I am currently doing an application and i am required to save data from edit boxes to a file and load them when need. I am familiar with the C++ , FILE *fp method of file i/o. But is there a proper and simple MFC method for doing file i/o ? (Sample code greatly appreciated =) ) Thanks
BeakX wrote:
But is there a proper and simple MFC method for doing file i/o ?
See the
CFile
andCStdioFile
classes.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
-
BeakX wrote:
But is there a proper and simple MFC method for doing file i/o ?
See the
CFile
andCStdioFile
classes.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
You can also consider persisting data using CArchive in MFC. George Mileka
-
You can also consider persisting data using CArchive in MFC. George Mileka
Perhaps BeakX could, too!
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
-
Perhaps BeakX could, too!
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
You can also use fstream.h To get data from the file make an object of ifstream and to write data to file, make an object of ofstream then use these objects just like cout and cin in c++. These are very easy to use. You can visit msdn.microsoft.com for the help on ifstream and ofstream. Good Luck. We Believe in Excellence -- modified at 23:21 Monday 20th February, 2006
-
I am currently doing an application and i am required to save data from edit boxes to a file and load them when need. I am familiar with the C++ , FILE *fp method of file i/o. But is there a proper and simple MFC method for doing file i/o ? (Sample code greatly appreciated =) ) Thanks
BeakX wrote:
But is there a proper and simple MFC method for doing file i/o ? (Sample code greatly appreciated =) )
I belive CStdioFile is one most stable File handlling class MFC have:)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
-
You can also use fstream.h To get data from the file make an object of ifstream and to write data to file, make an object of ofstream then use these objects just like cout and cin in c++. These are very easy to use. You can visit msdn.microsoft.com for the help on ifstream and ofstream. Good Luck. We Believe in Excellence -- modified at 23:21 Monday 20th February, 2006
Thanks. I'll be sure and let BeakX know. :rolleyes:
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain