OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:14 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Where MFC save the data temporarily?
PostPosted: Wed Nov 27, 2002 2:40 pm 
In VC++ when we can easily make the text editor using Microsoft Foundation Classes (MFC). I just want to know the place where it temporarily holds the data. I want to retrieve that data so that I can perform some function on it. My custom functions (not standard text editor functions). Any one can solve my problem


Top
  
 
 Post subject: Re:Where MFC save the data temporarily?
PostPosted: Wed Nov 27, 2002 2:46 pm 
CAchive ( I think ).


Top
  
 
 Post subject: Re:Where MFC save the data temporarily?
PostPosted: Wed Nov 27, 2002 4:12 pm 
well i might be wrong but can we actually RETRIEVE any data from cache ?? ???


Top
  
 
 Post subject: Re:Where MFC save the data temporarily?
PostPosted: Wed Nov 27, 2002 4:18 pm 
Cache...what does this have to do with that?


Top
  
 
 Post subject: Re:Where MFC save the data temporarily?
PostPosted: Wed Nov 27, 2002 8:50 pm 
then what is this "CAchive"?


Top
  
 
 Post subject: Re:Where MFC save the data temporarily?
PostPosted: Wed Nov 27, 2002 9:10 pm 
The instant text editor created by AppWizard uses a CEditView, which is basically a wrapper around the API edit control. The first thing I would recommend trying is CEditView::GetWindowText(), and if that doesn't work use CEdit::GetWindowText -- you can get a CEditView object's edit control by calling CEditView::GetEditCtrl or something like that. Look up CEditView in the msdn library.


Top
  
 
 Post subject: Re:Where MFC save the data temporarily?
PostPosted: Thu Nov 28, 2002 9:51 am 
I think what Tom meant to say was "CArchive", which is used for saving files and things like that. I haven't used it very much so I don't if it's used for anything else but that, but I do know that it is used for saving and loading files.

In any case, the text for an edit control (even one wrapped by CEdit or CEditView) is stored in the edit control's data area, which is managed by Windows and not MFC, and the data stored there is retrieved by a call to GetWindowText.


Top
  
 
 Post subject: Re:Where MFC save the data temporarily?
PostPosted: Thu Nov 28, 2002 10:08 am 
You can save any data to RAM and other stuff with CArchive...I think.


Top
  
 
 Post subject: Re:Where MFC save the data temporarily?
PostPosted: Sat Nov 30, 2002 5:15 pm 
CFile is a general class for doing file I/O. There are various subclasses of CFile, such as CMemFile and CInternetFile, which get their data from somewhere other than a disk.

A CArchive object can wrap anything derived from CFile, including CMemFile etc. (which is probably what Tom was thinking of). It lets you do things like:
Code:
CFile file("file.txt");
CArchive ar(&file);
ar << "Hello, world");


MFC's CDocument class uses CArchive to load and save data. If you look at the CDocument implementation for a text editor application generated by Class Wizard, you will see that the document's Serialize() method just uses the CEditView to read and write to and from the archive.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 29 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group