Design issue with SDI app
-
I am working on an SDI application with 3 different views(CFormView). There are 3-4 variables that are shared between those views. These variables should be saved in a file, so each time user starts the app its sees the interface as it was when he exited. I don't need to use CDocument, because I need just one file to store the settings for the app. Therefore, my questions are: 1) Where should I put those variables (CwinApp, CDocument or somewhere else)? 2) What other changes do I need to make, in order to have the app load the settings' file, when it starts, and save changes to the file when it exits? 3) How to 'turn off' support for creating new, opening and saving documents, since I don't need it? Any help would be appreciated.
-
I am working on an SDI application with 3 different views(CFormView). There are 3-4 variables that are shared between those views. These variables should be saved in a file, so each time user starts the app its sees the interface as it was when he exited. I don't need to use CDocument, because I need just one file to store the settings for the app. Therefore, my questions are: 1) Where should I put those variables (CwinApp, CDocument or somewhere else)? 2) What other changes do I need to make, in order to have the app load the settings' file, when it starts, and save changes to the file when it exits? 3) How to 'turn off' support for creating new, opening and saving documents, since I don't need it? Any help would be appreciated.
-
I am working on an SDI application with 3 different views(CFormView). There are 3-4 variables that are shared between those views. These variables should be saved in a file, so each time user starts the app its sees the interface as it was when he exited. I don't need to use CDocument, because I need just one file to store the settings for the app. Therefore, my questions are: 1) Where should I put those variables (CwinApp, CDocument or somewhere else)? 2) What other changes do I need to make, in order to have the app load the settings' file, when it starts, and save changes to the file when it exits? 3) How to 'turn off' support for creating new, opening and saving documents, since I don't need it? Any help would be appreciated.
If you don´t necessarily need a file, what about the registry, otherwise you could use the applications´ ini file. 1) If the Views are using the same CDocument and you don´t need these variables anywhere else than in these view, you might as well put them in CDocumen, otherwise in CWinApp 2) The CWinApp object gives a halfway decent support to write an read from the ini file CWinApp::WriteProfileInt CWinApp::GetProfileInt CWinApp::GetProfileString CWinApp::GetProfileString... when the app quits, you can write your stuff within the virtual CWinApp::ExitInstance()... 3) Easiest thing to do is to throw out the resources directly from the menu.
-
If you don´t necessarily need a file, what about the registry, otherwise you could use the applications´ ini file. 1) If the Views are using the same CDocument and you don´t need these variables anywhere else than in these view, you might as well put them in CDocumen, otherwise in CWinApp 2) The CWinApp object gives a halfway decent support to write an read from the ini file CWinApp::WriteProfileInt CWinApp::GetProfileInt CWinApp::GetProfileString CWinApp::GetProfileString... when the app quits, you can write your stuff within the virtual CWinApp::ExitInstance()... 3) Easiest thing to do is to throw out the resources directly from the menu.