Re: GetDocument()->UpdateAllViews() not updating all views...
MDI is "Multiple Document Interface" so it actually means multiple
documents, not multiple views.
SDI (Single Document Interface) would be single document, (possibly)
multiple views.
You may want to look into CDocument::AddView() (see
http://msdn2.microsoft.com/en-us/library/e59dtf8h(VS.80).aspx) instead of
opening new documents through OnFileNew().
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
<kmarcus98@gmail.com> wrote in message
news:1194032174.389865.216080@50g2000hsm.googlegroups.com...
Hello-
I have an MDI application. I thought in MDI there is one Document and
one or more Views to that single document.
I'm in a learning phase so I have this scribble type app where I'm
trying to have some free hand graphics in one view and when File|New
is clicked and a new view is created I want the new view to replicate
what I had already done in the first view. (or if there are multiple
views and one of them changes, I want all the other views to 'pick'
that change)
I am saving all data (very primitive circles, squares and such) in the
CMyDocument, and I'm using GetDocument()->UpdateAllViews() whenever i
add anything new to any of the views. and i have also overridden
OnUpdate() in CMyView to pick up any changes in any of the other
views................but it doesn't work.
Here is what I found.....after putting a break point on
CWinApp::OnFileNew()
CWinApp::OnFileNew() actually creates a new document object and a
corresponding view......it does not just create a new View and add to
the existing document. so my call to GetDocument()->UpdateAllViews()
always have ONE and only ONE view (the 'this' view).......
What is wrong here? am I wrong in the first place? one document and
multiple views?
I created the app using VC++ 2005 prof (trial version) using File|New
Project (MFC->MDI.....)