Is there an equivalent function to "DoModal()" for modeless dialogs?
-
Let's say I have two buttons: ID_BUTTON_START ID_BUTTON_END - is there a way (such as "if(myDlg.DoModal() == IDOK)..." to indicate that first or second button was pressed for a modeless dialog?
You could always use a bool varible within the class to keep track of this. -Nick Parker
-
Let's say I have two buttons: ID_BUTTON_START ID_BUTTON_END - is there a way (such as "if(myDlg.DoModal() == IDOK)..." to indicate that first or second button was pressed for a modeless dialog?
If I need to store state data from a modeless dialog box I usually pass a pointer to my CDocument and store it there. Otherwise when a button is pressed I send a command message to my main view window. This way the dialog can delete itself in the PostNcDestroy function without worrying about some function trying to look at data stored in the dialog class after it has been destroyed. John