11-18-2005, 07:50 AM
While in dialog proc, variables have default values, unless you call DT_GetControls.
Here is how all works:
1. When opening dialog, is called dialog procedure. Then message is WM_INITDIALOG. As you see, then is called DT_Init, which calls DT_SetControls, which initializes controls with interpreted values of dialog variables.
2. While dialog is open, dialog variables are not touched. That is, you don't have to reset variables. If you call DT_SetControls2, controls are reset to default values because variables have default values. But if you before called DT_GetControls, then variables are already changed, and if you want to reset all, reset each variable and then call DT_SetControls2.
3. When closing dialog with OK, is called dialog procedure. Then message is WM_COMMAND, and wParam is IDOK. Is called DT_Ok, which calls DT_GetControls, which collects values of controls and populates variables.
Here is how all works:
1. When opening dialog, is called dialog procedure. Then message is WM_INITDIALOG. As you see, then is called DT_Init, which calls DT_SetControls, which initializes controls with interpreted values of dialog variables.
2. While dialog is open, dialog variables are not touched. That is, you don't have to reset variables. If you call DT_SetControls2, controls are reset to default values because variables have default values. But if you before called DT_GetControls, then variables are already changed, and if you want to reset all, reset each variable and then call DT_SetControls2.
3. When closing dialog with OK, is called dialog procedure. Then message is WM_COMMAND, and wParam is IDOK. Is called DT_Ok, which calls DT_GetControls, which collects values of controls and populates variables.
