Simple !?! How to wait for OK
-
Hi, I've got a function that launches a simple dialog. How do I get the function to wait for the OK button to be pressed before returning?
void Import_Shader_Dialog::OnImportShaders() { Some_Dlg Progress; Progress.Create(IDD_IMPORT_SHADER_PROGRESS, NULL); Progress.ShowWindow(SW_SHOW); /*-------- Do Stuff...... ----------*/ //----------------HOW DO I:----------------------- // !!!!!!wait until OK button has been pressed!!!!! //------------------------------------------------ while(its_not_ok); //wait return; }
I've tried making the dialog modal but then of course none of the function gets executed while the dialog is up. The way it is, it just appears as long as the function is executing(very quick). So how can I get my child dialog to stay up and receive messages from my program until the OK button is pressed? Thanks Josh josh@that-guy.net -
Hi, I've got a function that launches a simple dialog. How do I get the function to wait for the OK button to be pressed before returning?
void Import_Shader_Dialog::OnImportShaders() { Some_Dlg Progress; Progress.Create(IDD_IMPORT_SHADER_PROGRESS, NULL); Progress.ShowWindow(SW_SHOW); /*-------- Do Stuff...... ----------*/ //----------------HOW DO I:----------------------- // !!!!!!wait until OK button has been pressed!!!!! //------------------------------------------------ while(its_not_ok); //wait return; }
I've tried making the dialog modal but then of course none of the function gets executed while the dialog is up. The way it is, it just appears as long as the function is executing(very quick). So how can I get my child dialog to stay up and receive messages from my program until the OK button is pressed? Thanks Josh josh@that-guy.netIs this dialog intended to be some sort of progress dialog or monitoring dialog of some type for the other code thats processing? "I never met anyone I didn't like" Will Rogers.
-
Hi, I've got a function that launches a simple dialog. How do I get the function to wait for the OK button to be pressed before returning?
void Import_Shader_Dialog::OnImportShaders() { Some_Dlg Progress; Progress.Create(IDD_IMPORT_SHADER_PROGRESS, NULL); Progress.ShowWindow(SW_SHOW); /*-------- Do Stuff...... ----------*/ //----------------HOW DO I:----------------------- // !!!!!!wait until OK button has been pressed!!!!! //------------------------------------------------ while(its_not_ok); //wait return; }
I've tried making the dialog modal but then of course none of the function gets executed while the dialog is up. The way it is, it just appears as long as the function is executing(very quick). So how can I get my child dialog to stay up and receive messages from my program until the OK button is pressed? Thanks Josh josh@that-guy.netIf I understand your problem correctly, you just want to display a progress dialog during lenghty operation. If this is the case, have a look at Feb'97 issue of MSJ; there's a column titled 'Wicked Code' which describes CWaitDialog class. Tomasz Sowinski -- http://www.shooltz.com
-
Is this dialog intended to be some sort of progress dialog or monitoring dialog of some type for the other code thats processing? "I never met anyone I didn't like" Will Rogers.
Yes, It just supposed to display output strings in a listbox. Josh josh@that-guy.net
-
If I understand your problem correctly, you just want to display a progress dialog during lenghty operation. If this is the case, have a look at Feb'97 issue of MSJ; there's a column titled 'Wicked Code' which describes CWaitDialog class. Tomasz Sowinski -- http://www.shooltz.com
Cool, thanks... Josh josh@that-guy.net
-
Yes, It just supposed to display output strings in a listbox. Josh josh@that-guy.net
In that case just follow Tomaz's advice. "I never met anyone I didn't like" Will Rogers.
-
Hi, I've got a function that launches a simple dialog. How do I get the function to wait for the OK button to be pressed before returning?
void Import_Shader_Dialog::OnImportShaders() { Some_Dlg Progress; Progress.Create(IDD_IMPORT_SHADER_PROGRESS, NULL); Progress.ShowWindow(SW_SHOW); /*-------- Do Stuff...... ----------*/ //----------------HOW DO I:----------------------- // !!!!!!wait until OK button has been pressed!!!!! //------------------------------------------------ while(its_not_ok); //wait return; }
I've tried making the dialog modal but then of course none of the function gets executed while the dialog is up. The way it is, it just appears as long as the function is executing(very quick). So how can I get my child dialog to stay up and receive messages from my program until the OK button is pressed? Thanks Josh josh@that-guy.netuse Progress.DoModal() but put your function code into the dialog class's InitInstance() so that the function runs when the dialog opens up. Then you can send function-related info to the dialog using member variables of the dialog and UpdateData() Hope this helps...