Question about document/view app in MFC
I have a real general question, but can post specific code if it helps illustrate my question. When I create a document/view app with the app wizard in VC++ 6.0, it automatically sets up the visual aspect of the File - Open, File -Save, etc options.
I am trying to write an app that will load a simple text (ASCII) document in the window. To do this, I know that I have to add code to the Serialize function. What I do is something similar to the following:
In the above example, mStr is a CString. When I do this and compile it and attempt to open an ASCII file, I only see the first line of the file and it seems to cut off the first letter of the line as well. I figure it has something to do with putting the value of ar into a CString rather than a better storage container, but I am not sure which storage container to use. Should I be usiing a character array or something? I think that once I know which storage container works best for my needs, it'll work just fine.
void CTestDoc::Serialize(CArchive& ar)
ar << mStr ;
// TODO: add storing code here
ar >> mStr;
// TODO: add loading code here
Any nudges in the right direction would be great!
Thanks as always!