saving and opening

Posted on 1998-06-05
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.
Question by:hartman2
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Expert Comment

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'.

Author Comment

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.

Expert Comment

ID: 1316058
Use StdioFile class.

Author Comment

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.

Accepted Solution

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'.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Installing Microsoft R server on REDHAT or SUSE Linux 4 152
Line meaning 9 91
Use of condition with 'serial' in ansible 2 88
moto 4g phone enable finger print 4 48
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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