Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Saving the file contents in a view class

Posted on 2003-03-24
4
Medium Priority
?
180 Views
Last Modified: 2013-11-20
I have an MDI application where each child document is divided into three panes.One pane has a treeview, another has a listview, 3rd pane has a normal CView. All the changes I make in these are stored in a single file. How do I implement serialization for these ?
  If I create an application with Richedit view as the base class,then all these are handled automatically.Some concepts include

1. On Saving a new document only once a save dialog is flashed.On saving subsequently the dialog box is not flashed.But the contents are saved.
2. Similarly on opening a saved document and then subsequently saving it doesn't flash the save dialog box.But the contents are saved.

All these I could implement in my application by setting a flag. Is there any other alternative to this which could make it more efficient? Is serialization behind it ?

3.On closing the document it automatically asks whether to save it in a Rich edit application. How do I track it in an ordinary application as mine? This is the major glitch I face.Pls help.

thanx in advance
cira


0
Comment
Question by:cira
[X]
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
4 Comments
 
LVL 3

Accepted Solution

by:
aphillips earned 100 total points
ID: 8197875
The three views should be different views of the same data stored in the associated document, or if they use different but related data all the data should be stored togetherin the document.  Thence serializing the document will save/restore the data.  You need to write the serialization code, of course.

The putting up of the "Save As" dialog in a new document is all handled by MFC.  Basically all you have to worry about is that if the user does something that changes the document you need to call SetModifiedFlag().

Does this answer your question?


0
 

Author Comment

by:cira
ID: 8201998
There is only one document class for this application.How do i associate each view's changes to the document ? Will u suggest any sample code for this implementation.

thnx in advance.
0
 
LVL 3

Expert Comment

by:aphillips
ID: 8216557
Normally when you create a view you specify a document.  How do you create your views?
0
 

Author Comment

by:cira
ID: 8216760
In my application I have many classes all derived from many View classes such as TreeView,ListView etc.Now i have understood the concept behind associating class data to the corresponding document.Thus enabling serialization.

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

705 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