-
June 19th, 2012, 04:42 PM
#1
MFC UpdateWindow()???
Inside my CRichEditCtrl class,
I have a loop that changes the text using
SetWindowText(a);
UpdateWindow();
But the window is not being updated to the text. I know this because when I'm in debugging mode, updatewindow does not change the text after the debug step. I'm I using UpdateWindow() wrong?
Last edited by printz0r; June 19th, 2012 at 04:57 PM.
-
June 19th, 2012, 06:15 PM
#2
Re: MFC UpdateWindow()???
You shouldn't need it. Show your real code. Is your SetWindowText call in a tight loop?
-
June 20th, 2012, 02:17 AM
#3
Re: MFC UpdateWindow()???
SetWindowText does not require a call to UpdateWindow() to show the updated content. CWnd itself take care of that and you no need to specify that explicitly.
-
June 20th, 2012, 03:42 AM
#4
Re: MFC UpdateWindow()???
Window is redrawn only when current message handler exits. Don't expect window to be redrawn on every loop iteration.
UpdateWindow is not required after SetWindowText.
Replace loop with timer, changing window text on every timer tick.
-
June 20th, 2012, 07:08 AM
#5
Re: MFC UpdateWindow()???
Originally Posted by Alex F
Replace loop with timer, changing window text on every timer tick.
I'm not following the thinking on that one.
-
June 20th, 2012, 03:09 PM
#6
Re: MFC UpdateWindow()???
Originally Posted by Alex F
Window is redrawn only when current message handler exits. Don't expect window to be redrawn on every loop iteration.
UpdateWindow is not required after SetWindowText.
Replace loop with timer, changing window text on every timer tick.
Using SetEventMask(GetEventMask()|ENM_UPDATE); fixed the problem, so directly after UpdateWindow() is called, the text gets displayed. But how would I do a timer tick method?? That seems more efficient.
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
|