Solved

saving and opening

Posted on 1998-06-05
5
453 Views
Last Modified: 2013-11-19
I have gotten privious help on how to create file dialog box but now I can't figure out the code to actually save and open data into the dialog boxs member valiables by using the file dialog box.
0
Comment
Question by:hartman2
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:chacko
ID: 1316056
The first parameter to the 'CFileDialog' is FALSE/TRUE to say whether it is Open/Save Dialog. After executing 'DoModal' you can get the file name thru the function 'GetPathName'.
0
 

Author Comment

by:hartman2
ID: 1316057
I think that you mis understood me.  The code that I have will create a file by using dialog boxes. I wanted to know how to store the data into the file that the user created.  Reminder I am creating a dialog based program.  I wanted to store numbers and  strings into the file.
0
 
LVL 1

Expert Comment

by:chacko
ID: 1316058
Use StdioFile class.
0
 

Author Comment

by:hartman2
ID: 1316059
I do not think that the CStdioFile will work. But I am in despret need to know how to write member variable to the file that the user creates.  Any and all help will be appreciated.
0
 
LVL 1

Accepted Solution

by:
guruprasad031298 earned 50 total points
ID: 1316060
Use the serialize functionality. Lookup the Serialize method & CArchive classe and also topics on serialization.

Serialization works with your document. So, if you have a good document-view architecture, then serialization is the best way to go for 'Saving & Opening files'.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now