Hello,
How would I enable my MDI-view application to open *.txt files for viewing/editing, please?
I tried changing the fields in the document template string (to include (*.txt), etc.), but all in vain.
Thank you.
Hello,
How would I enable my MDI-view application to open *.txt files for viewing/editing, please?
I tried changing the fields in the document template string (to include (*.txt), etc.), but all in vain.
Thank you.
Have a look at this.
I've tried it, and it transpires that MULTIPAD can only successfully view the txt files that it had itself created (or, rather, the files that had been created within it). If we try creating and saving a (test text) file in Notepad, MULTIPAD can't open it correctly!
Still, thanks for giving me the direction!
For those still looking for the solution to my original problem (ie just being able to view txt files):
Assuming we've got a CEditView-derived class (NOT like in the MULTIPAD sample), just over-write the code in your CDocument-derived class's Serialize() function with the following line:
((CEditView*)m_viewList.GetHead())->SerializeRaw(ar);
(Source: "The MFC Answer Book" by Eugene Kain.)