|
-
April 23rd, 1999, 07:03 AM
#1
Modeless dialog
I create a modeless dialog in a window,and I overload the function "OnPaint".
At begin it works correctly.However,when I create this dialog ,the dialog abruptly repaint itself endlessly,(I use debug to confirm it) and the cpu's usage is 100%.So I can't do anything!How can I avoid this thing? Thanks a lot!
-
April 23rd, 1999, 11:19 AM
#2
Re: Modeless dialog
If you have a dialog that paints continously maybe you need to put a BOOLEAN variable in the class header and then use the boolean variable to make the onpaint function do something or not?
-
April 23rd, 1999, 12:21 PM
#3
Re: Modeless dialog
It sounds as if you are calling the Invalidate function within the OnPaint function. Never to that.
-
May 9th, 1999, 10:48 PM
#4
Re: Modeless dialog
Say your dialog modeless is Cwaitdlg then
BOOL CWaitDlg::Create()
{
return CDialog::Create(CWaitDlg::IDD);
}
and
use
waitdlg=new CWaitDlg();
waitdlg->Create();
//do your stuff
delete waitdlg;//kill it
Hope this helps
-
June 29th, 1999, 02:46 PM
#5
Re: Modeless dialog
Did you suppress the Paint object created by default in the OnPaint method?
You must keep it otherwise you will loop like you said.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|