'CDocument::UpdateAllViews' : illegal call of non-static member function problem
-
Hi I have a prob here as follow: I have a SDI program based on CView. From the program, a dialog box was called. However from the dialog box i need to call the UpdateAllView function (which is found as a based function of CView) to update all Views of my main program. Is it possible to do so ?? When i tried doing it i got a complier error "'CDocument::UpdateAllViews' : illegal call of non-static member function" How can i go abt calling a CView based class function from a dialog based class ?? Thank you !! bk
-
Hi I have a prob here as follow: I have a SDI program based on CView. From the program, a dialog box was called. However from the dialog box i need to call the UpdateAllView function (which is found as a based function of CView) to update all Views of my main program. Is it possible to do so ?? When i tried doing it i got a complier error "'CDocument::UpdateAllViews' : illegal call of non-static member function" How can i go abt calling a CView based class function from a dialog based class ?? Thank you !! bk
modify the constructor of your dialog class so that it accept a document object.. once you done that, you should be able to call updateallviews from a dialog.. something like this: Cmydialog dialog(...,pDoc); pDoc is the document object that you use to call updateallviews from the your dialog.
-
modify the constructor of your dialog class so that it accept a document object.. once you done that, you should be able to call updateallviews from a dialog.. something like this: Cmydialog dialog(...,pDoc); pDoc is the document object that you use to call updateallviews from the your dialog.
Hi trustnol, firstly thanx a lot for your help ... I am quite new in C++ so i am very bad in those object kind of things... therefore i still have some doubts which i like to clarify with u .... 1. constructor is like this ?? CmyDialog dialog (CDocument *pDoc) 2. becos wat calling my dialog is the doc class of my main program ... so do i do pass the "this" pointer over to the dialog constructor ?? CABCdoc::onopen() { Cmydialog efg(this); } is this correct ??? thank you very much for your kind attention !!