If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: A Question about SDI

If i right understand you:

MSDN:
"When data in a document changes, the view responsible for the changes typically calls the CDocument::UpdateAllViews function for the document, which notifies all the other views by calling the OnUpdate method for each. The default implementation of OnUpdate invalidates the entire client area of the view. You can override it to invalidate only those regions of the client area that map to the modified portions of the document."

So in you document add data to some class and call UpdateAllViews(), then in view OnUpdate call GetDocument() and check data in document.

Re: A Question about SDI

OnUpdate is one of virtual overrides not a message handler. Simply choose add virtual function and wizard will insert it for you.
You will have to have GetDocument overridden too, and all data that is to be serialized should be in a document object, if you do not want to call view’s Serialize.

There are only 10 types of people in the world:Those who understand binary and those who do not.

Re: A Question about SDI

Originally Posted by TOMNKZ

If i right understand you:

MSDN:
"When data in a document changes, the view responsible for the changes typically calls the CDocument::UpdateAllViews function for the document, which notifies all the other views by calling the OnUpdate method for each. The default implementation of OnUpdate invalidates the entire client area of the view. You can override it to invalidate only those regions of the client area that map to the modified portions of the document."

So in your document add data to some class and call UpdateAllViews(), then in view OnUpdate call GetDocument() and check data in document.

This makes sence except that I want to get the CTreeView and I can only find a method to get the TreeCntrl. I want to update the tree. Do I use the CTreeView or do I use the CTreeCtrl?