SEND MESSAGE
-
Hi, i have two view CMyViewOne,CMyViewTwo both derived from CBaseView and CBaseView is derived from CView.I have a function named "OnComplete" in CMyViewOne,in this function i want to send a Message to CMyViewTwo,by using SendMessage function.How to do it..? Like i want to establish a communication between both the views.. Thanks in before. James
-
Hi, i have two view CMyViewOne,CMyViewTwo both derived from CBaseView and CBaseView is derived from CView.I have a function named "OnComplete" in CMyViewOne,in this function i want to send a Message to CMyViewTwo,by using SendMessage function.How to do it..? Like i want to establish a communication between both the views.. Thanks in before. James
In document-view architectures views don't directly communicate; all communication occurs via the document. If view 1 needs to “talk” to view 2 then view 1 should update the document and the document will notify all applicable views, in this case view 2.
Steve
-
In document-view architectures views don't directly communicate; all communication occurs via the document. If view 1 needs to “talk” to view 2 then view 1 should update the document and the document will notify all applicable views, in this case view 2.
Steve
Thanks for the reply,Can you be more clear ,please. Like how to send the event to document,from there to respective view
-
Thanks for the reply,Can you be more clear ,please. Like how to send the event to document,from there to respective view
I assume you're using MFC. From a view can can get access to its document via the
GetDocument
function the wizard generates for you in the view class. Your document class should provide functions to modify the state of the document. The functionCDocument::UpdateAllViews
on the document is used by the code in the document (or view) to inform all views (thepSender
parameter can be used to exclude the sending view if required) of a change in the state of the document.Steve