Thanks to all the people who replied to my posting about the window
sizes. Here is a new question:
I have a modal dialog box in my application, when the OK
button is clicked, some intensive calculations will be done which
takes a long time (longer than a minute). The dialog box won't
disappear from the screen until the calculation is finished (even
if I destroy/close it explicitly in my code). I guess it is because
the windows hasn't had a chance to update the screen. I am wondering
if there is a SIMPLE way (like a function call, perhaps) to make the
dialog box disappear from the screen immediately after the OK button
is clicked. The reason I want the dialog box to disappear is that it
looks really bad on the screen (part of window under it will show
after the OK button is clicked). Thanks for any help.
Xiangyang Liu
<your class>::OnOK()
{
CDialog::OnOK();
<...your calculation code...>
}
Hope this helps
Tony Luu
================================================
Tony T. Luu Tony...@SanDiegoCA.ATTGIS.COM
AT&T Global Information Solutions, SPD San Diego
17095 Via del Campo San Diego, CA 92127-1711
Tel.619-485-3383 Fax.619-485-3408
XL> I have a modal dialog box in my application, when the OK
XL> button is clicked, some intensive calculations will be done which
XL> takes a long time (longer than a minute). The dialog box won't
XL> disappear from the screen until the calculation is finished (even
XL> if I destroy/close it explicitly in my code).
Maybe the calculations should be done after the Dialog procedure EndDialog
has been called? For example, instead of running the calculations from an
OnOK function, calculate once the DoModal() function returns to the
original caller.
--
Jonathan "Jack" Vinson jvi...@cheux.ecs.umass.edu
Sunderland, MA <http://www.cis.upenn.edu/~vinson/home.html>
"Churchill was a shopping bag" - Fatima Mansions
>
>
>Thanks to all the people who replied to my posting about the window
>sizes. Here is a new question:
>
> I have a modal dialog box in my application, when the OK
>button is clicked, some intensive calculations will be done which
>takes a long time (longer than a minute). The dialog box won't
>disappear from the screen until the calculation is finished (even
>if I destroy/close it explicitly in my code). I guess it is because
>the windows hasn't had a chance to update the screen. I am wondering
>if there is a SIMPLE way (like a function call, perhaps) to make the
>dialog box disappear from the screen immediately after the OK button
>is clicked. The reason I want the dialog box to disappear is that it
>looks really bad on the screen (part of window under it will show
>after the OK button is clicked). Thanks for any help.
Call "UpdateWindow" after the dialog box disappears. This forces a screen
redraw.
Chris
--
--------------------------------------------------------------------------
Chris Marriott, Warrington, UK | Author of SkyMap v2 award-winning
ch...@chrism.demon.co.uk | shareware Windows planetarium.
For full info, see http://www.execpc.com/~skymap
Author member of Association of Shareware Professionals (ASP)
--------------------------------------------------------------------------
In MFC, call the ShowWindow function to hide it in your OK handler:
CMyDialog::OnOK()
{
ShowWindow( SW_HIDE );
// Do processing...
CDialog::OK();
}
Thanks to all the people who responded to my posting. I have tried
all the solutions (UpdateWindow(), ShowWindows(SW_HIDE), etc), but
the problem is still there. Any more help will be appreciated.
Xiangyang Liu
[]In article <812054...@chrism.demon.co.uk>,
[]Chris Marriott <ch...@chrism.demon.co.uk> wrote:
[]>In article <442m9v$a...@oac4.hsc.uth.tmc.edu>
[]> l...@valhalla.mda.uth.tmc.edu "Xiangyang Liu ~{AuOrQt~}" writes:
[]>
[]>> I have a modal dialog box in my application, when the OK
[]>>button is clicked, some intensive calculations will be done which
[]>>takes a long time (longer than a minute). The dialog box won't
[skip]
[]Thanks to all the people who responded to my posting. I have tried
[]all the solutions (UpdateWindow(), ShowWindows(SW_HIDE), etc), but
[]the problem is still there. Any more help will be appreciated.
Just EndDialog, make your calculation , and..
DialogBox again ( if You need it ). DID You try this?!