Hello:
I use VC++6.0 MFC.I read data file in Doc Class(archieve()).
How can I send the data from doc class to view class?
Would you help me?
Yoh-Hei
Printable View
Hello:
I use VC++6.0 MFC.I read data file in Doc Class(archieve()).
How can I send the data from doc class to view class?
Would you help me?
Yoh-Hei
With the UpdateAllViews-method of the CDocument-class you can notify your
views of updates in the document.
This method calls the CView::OnUpdate method for each of the document's view.
the doc is meant for containg the data. so read all the contents and store them in variables in document class. now access these variables from the view class using the pointer to document. you can get pointer to the document using GetDocument() in your view class. If already there is a code in OnDraw( ) which uses the data variables in the document class simply call the UpdataAllViews() after serializing the data in document class. This will call the OnDraw function of all the existing views. So the code written in OnDraw will use the new values.
thankyou,
prasanth