Johnny DeMichael
May 1st, 1999, 09:58 AM
Please bear with me here. 1st, I'm not trying to short-cut the learning curve, but the (2) books I am studying really do not make it clear how doc data is kept up-to-date.
I understand the basis doc-view relationships & DDX to copy control data to member variables in the view class . . . but when & where do the variables in the doc class get updated? Is there anything automatic going on (similar to DDX)?
For example, assume your only data (in your doc class) is say, CString mystr . . . and you derive your view from a CFormView & initialize the view variable mystr & the user (by using an edit control in your MyFormView class enters data. The DDX copies the new data from your control to the variable in the view class. How does the mystr variable in the doc class get (updated) the new data? Seems like there should be something similar to the DDX mechanism to update the variables in the doc class.(?) Does the programmer have to copy the content of the variables contained in the view class to the variables contained in the doc class? If so, when is this normally done . . within what function of the view class?
Thanks alot for any simple explanations.
I understand the basis doc-view relationships & DDX to copy control data to member variables in the view class . . . but when & where do the variables in the doc class get updated? Is there anything automatic going on (similar to DDX)?
For example, assume your only data (in your doc class) is say, CString mystr . . . and you derive your view from a CFormView & initialize the view variable mystr & the user (by using an edit control in your MyFormView class enters data. The DDX copies the new data from your control to the variable in the view class. How does the mystr variable in the doc class get (updated) the new data? Seems like there should be something similar to the DDX mechanism to update the variables in the doc class.(?) Does the programmer have to copy the content of the variables contained in the view class to the variables contained in the doc class? If so, when is this normally done . . within what function of the view class?
Thanks alot for any simple explanations.