SDI - Displaying data in a View window and modifying it using a Custom Dialog box

I have created a dialog based MFC program, which will read in a student record (name, num of grades,type of test, letter grade and number grade) and then edit each of the data members (by calling a custom dialog through a button). The way I handled the "reading from file" and writing to file" from the Student class is by defining:
istream & operator >> (istream& is,CStudent& s) to input data and
stream & operator<<(ostream& os, const CStudent& s) to output data.
I would then open a file from the Dialog application this way:
ifstream ifl;"student1.txt");
Then I would call ifl >> s from the Project1Dlg.cpp to load data into the object "s" (which is of type CStudent), then would retrieve each of the data members and format them to be displayed onto the text boxes and list boxes. In the same way, I would call ifl<<s  from Project1Dlg.cpp to restore the file with the modifed data members.

The student record in the file student1.txt looks like this(the variables are listed along with it):
Joe Green      // mFirstname    mLastname
14                 // mNumofGrade
Test1 A 100   // mTestaname   mLetGrade   mNumGrade
Test2 A 99
Test3 A 98
Test4 A 97

Now, I would like to use the student record program but with an SDI application (doc view architecture).
I would like to make files of type .rec to be only displayed when selecting "open" (which I know how to do by changing the properties in the String Table).
The text of the file has to be displayed in the View window (raw format), and I would like to call a custom dialog from the menu choice to edit all the data in the single record and update them in memory.
I want to eliminate the Save/Exit buttons that I used in the dialog box, and want to save using the "Save" and "Save as" menu choices already available in the SDI app.
I've played around well with dialog boxes but am a little confused about how to handle SDI (doc/view and synchronization) ?? Should I used "CEditView" as my base class here? If so, how would I read the data from the CEditView and then store it into variables, which would need to be updated when I modify all the data in the record with the Custom dialog box?? How could I write back to the CEditView from the Control variables in the Custom dialog box??

Any sample code would be really useful. thanks for your help!

Who is Participating?
You Store all data in Document then access this data from dialog and modify it.

In View just display this data
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.