Help with program structure
-
http://www.geocities.com/stormcatcher712/sample.html[^] Its an image of my private project. I'm still a beginner an so I have several questions. First some word about the structure of my application. It is a single doc app created with the VC++ 6.0 project wizard. At the right site you see the applications docview. It contains a CListCtrl. At the left side I managed to add a CDialogBar with a dialog conaining a CTabCtrl. If you switch the tabs the checkbuttons and texteditfields will be activated or deactivated. Now my questions: 1) I want to manipulate the CListCtrl from within the CDialogBar dialog. If you push the start button some processing should be done and the result should be displayed in the right View. How can I do this? As I see it there is no way to give the doc or view class access to the dialogbar class and the other way too. X| 2) Isn't there an easy and simple example of an application that uses register cards and diffent dialogs on every page? You know like the preferences dialog unter Visual C++ -> Project -> Preferences ? Or think about the tiny search program for Windows 95, 98, 2000? :omg: It has all elements I need for my application. Different Dialogs with a propertysheet, and the result of the processing is displayed in an explorerlike Listview. Although it is just a simple application I did not see sourcecode for a similar program. Thank you for your time and help! :rose:
-
http://www.geocities.com/stormcatcher712/sample.html[^] Its an image of my private project. I'm still a beginner an so I have several questions. First some word about the structure of my application. It is a single doc app created with the VC++ 6.0 project wizard. At the right site you see the applications docview. It contains a CListCtrl. At the left side I managed to add a CDialogBar with a dialog conaining a CTabCtrl. If you switch the tabs the checkbuttons and texteditfields will be activated or deactivated. Now my questions: 1) I want to manipulate the CListCtrl from within the CDialogBar dialog. If you push the start button some processing should be done and the result should be displayed in the right View. How can I do this? As I see it there is no way to give the doc or view class access to the dialogbar class and the other way too. X| 2) Isn't there an easy and simple example of an application that uses register cards and diffent dialogs on every page? You know like the preferences dialog unter Visual C++ -> Project -> Preferences ? Or think about the tiny search program for Windows 95, 98, 2000? :omg: It has all elements I need for my application. Different Dialogs with a propertysheet, and the result of the processing is displayed in an explorerlike Listview. Although it is just a simple application I did not see sourcecode for a similar program. Thank you for your time and help! :rose:
ryuki wrote: As I see it there is no way to give the doc or view class access to the dialogbar class and the other way too. For MFC SDI applications :
((CFrameWnd*)AfxGetMainWnd())->GetActiveView()
return pointer to you CView class,((CFrameWnd*)AfxGetMainWnd())->GetAcviteDocument()
return pointer to you CDocument class. ;P -
ryuki wrote: As I see it there is no way to give the doc or view class access to the dialogbar class and the other way too. For MFC SDI applications :
((CFrameWnd*)AfxGetMainWnd())->GetActiveView()
return pointer to you CView class,((CFrameWnd*)AfxGetMainWnd())->GetAcviteDocument()
return pointer to you CDocument class. ;PThat simple... X| I read "MFC in 21 days", and they mentioned it earlier but I forgot. Sometimes I wonder if I will ever get used to the whole document - view and message concept of MFC. Think about that, there is no member for the CYOURDoc and CYOURView in any class in your whole project. Thank you again!
-
That simple... X| I read "MFC in 21 days", and they mentioned it earlier but I forgot. Sometimes I wonder if I will ever get used to the whole document - view and message concept of MFC. Think about that, there is no member for the CYOURDoc and CYOURView in any class in your whole project. Thank you again!
do you know c++ class ? ;)
class CYOUView : public CView { int m_int; };
If you try compile that string:... GetActiveView()->m_int ...
you got error "m_int not member of class CView" but if you write:... ((CYOUView*)GetActiveView())->m_int ...
that will compile, and work whith no error's ;)