Dialog Communication
-
Good day, I have two dialogs. The MainDialog and WelcomeDialog. WelcomeDialoghas a progress bar and MainDialog has the initialization in which this initialization status is shown in WelcomeDialog progressbar. I have a function in WelcomeDialog IncreaseProgressBarStep(int step) which is public so MainDialog can access it. Here is what i wanted to do. MainDialog::OnInitDialog() { WelcomeDialog childDlg; childDlg.DoModal(); ->InitializationStatement.... childDlg.IncreaseProgressBarStep(10); InitializationStatement.... childDlg.IncreaseProgressBarStep(10); ............(until all initialization is done) done initialization here.... } The problem with this code is that the code with ->InitializationStatement will not be called unless the childDlg is exited, thus childDlg.IncreaseProgressBarStep will be useless. How can we communicate the two dialogs so that WelcomeDialog will stay on the screen while whole initilization is not yet done. Thanks and More Power!
-
Good day, I have two dialogs. The MainDialog and WelcomeDialog. WelcomeDialoghas a progress bar and MainDialog has the initialization in which this initialization status is shown in WelcomeDialog progressbar. I have a function in WelcomeDialog IncreaseProgressBarStep(int step) which is public so MainDialog can access it. Here is what i wanted to do. MainDialog::OnInitDialog() { WelcomeDialog childDlg; childDlg.DoModal(); ->InitializationStatement.... childDlg.IncreaseProgressBarStep(10); InitializationStatement.... childDlg.IncreaseProgressBarStep(10); ............(until all initialization is done) done initialization here.... } The problem with this code is that the code with ->InitializationStatement will not be called unless the childDlg is exited, thus childDlg.IncreaseProgressBarStep will be useless. How can we communicate the two dialogs so that WelcomeDialog will stay on the screen while whole initilization is not yet done. Thanks and More Power!
Anonymous wrote: The problem with this code is that the code with ->InitializationStatement will not be called unless the childDlg is exited Of course, this is logical. DoModal is a blocking call that will return the return code of closing the dialog. If you want to have childDlg 'not blocking' you will have to make it modeless. That is, maitaint a member variable in MainDialog and show the window. Take a look at this article[^]. It will help you to understand how it works.
-
Anonymous wrote: The problem with this code is that the code with ->InitializationStatement will not be called unless the childDlg is exited Of course, this is logical. DoModal is a blocking call that will return the return code of closing the dialog. If you want to have childDlg 'not blocking' you will have to make it modeless. That is, maitaint a member variable in MainDialog and show the window. Take a look at this article[^]. It will help you to understand how it works.