Reputation: 33
I am creating a dialog based application, I found there are two components, which are dlg and app.
My question is, what is their different and if I want to write back end logic for the application, which file I should write to for better practice ?
My back end logic means: e.g: creating an application receives input from two text boxes and sum them up my back end logic means the function to sum up two variables.
Upvotes: 1
Views: 540
Reputation: 15375
The application (CWinApp) is the outer container, that contains all application specific stuff. The application object is a singleton.
The CMyDialog class carries out the UI and all actions belonging to one dialog.
Because an application may have more than one dialog class, you are not restricted to have only one dialog. But you always have only one application object.
So your logic should all be located in the dialog class.
The dialog and the application may exchange results and data. The normal logic is to copy the data from the application into member objects in the dialog. Launch the dialog. After the dialog is successfully executed the values are copied back.
Upvotes: 3