Where MFC save the data temporarily?
Where MFC save the data temporarily?
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
Re:Where MFC save the data temporarily?
well i might be wrong but can we actually RETRIEVE any data from cache ?? ???
Re:Where MFC save the data temporarily?
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.
Re:Where MFC save the data temporarily?
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.
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.
Re:Where MFC save the data temporarily?
You can save any data to RAM and other stuff with CArchive...I think.
Re:Where MFC save the data temporarily?
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:
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.
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: Select all
CFile file("file.txt");
CArchive ar(&file);
ar << "Hello, world");