Assigning parent to a Dialog
-
Hi Guys I've got my CMyFormView class I define a Dialog and Create a Class for this dialog called CMyDialog From CMyFormView I call an instance of CMyDialog Ex: . . . CMyDialog dlgTest; dlgTest.DoModal(); . . . What's the right way to acces from inside dlgTest the CMyFormView members? (I could continue the question with... ...to avoid that each time that I touch the CMyDialog.h the complete app recompiles ?) Ex: BOOL CMyDialog::OnInitDialog() { CDialog::OnInitDialog(); // Write code here to acces m_nNumber a int variable declared in CMyFormView.h return TRUE; } Thanks
-
Hi Guys I've got my CMyFormView class I define a Dialog and Create a Class for this dialog called CMyDialog From CMyFormView I call an instance of CMyDialog Ex: . . . CMyDialog dlgTest; dlgTest.DoModal(); . . . What's the right way to acces from inside dlgTest the CMyFormView members? (I could continue the question with... ...to avoid that each time that I touch the CMyDialog.h the complete app recompiles ?) Ex: BOOL CMyDialog::OnInitDialog() { CDialog::OnInitDialog(); // Write code here to acces m_nNumber a int variable declared in CMyFormView.h return TRUE; } Thanks
-
doctorpi wrote:
What's the right way to acces from inside dlgTest the CMyFormView members?
The dialog should not access the View members. See the Model-View-Controller Design Pattern.
led mike
-
doctorpi wrote:
What's the right way to acces from inside dlgTest the CMyFormView members?
The dialog should not access the View members. See the Model-View-Controller Design Pattern.
led mike
Just one question then. If I want to modify from the CMyDialog the CDocument it's mandatory include the CMyDocument.h ? Then always the complete app is recompiled if I add a member to my CMyDialog? And then If CMyDialog affects CMyFormView (through CMyDocument) I have to update with Updateallviews from CMyDocument? Thanks -- modified at 14:31 Wednesday 11th April, 2007
-
Just one question then. If I want to modify from the CMyDialog the CDocument it's mandatory include the CMyDocument.h ? Then always the complete app is recompiled if I add a member to my CMyDialog? And then If CMyDialog affects CMyFormView (through CMyDocument) I have to update with Updateallviews from CMyDocument? Thanks -- modified at 14:31 Wednesday 11th April, 2007