Zaphod®
2003-07-15 21:07:52 UTC
If you just open the MSND libraty on WM_PAINT or CWnd::OnPaint you will find
yourself warned that you should not use OnPaint to execute application
defined paint code.
Views have OnDraw which is suitable to run paint and draw code (Erase
backgrownd message is also available), however you can reconsider using view
that inherits CFormView maybe.
regards.
yourself warned that you should not use OnPaint to execute application
defined paint code.
Views have OnDraw which is suitable to run paint and draw code (Erase
backgrownd message is also available), however you can reconsider using view
that inherits CFormView maybe.
regards.
I'm having a few problems with WM_PAINT within dialogs.
In one particular dialog, I am calling OnPaint() a total
of THREE times during initialisation yet still the stuff
I'm painting doesn't appear.
It may be a timing issue as I've had a bug report that one
of the dialogs in my app doesn't display a picture on a
paticular PC 50% of the time, and I've just encountered
the problem here on another dialog after adding some
seemingly innocent code (which could only mean its timing
related?).
Have I missed something important to do with painting on
dialogs ?
All's I can think off is that some kind of background
erase is going on without a following WM_PAINT ... trouble
is for some reason dialogs don't have a WM_ERASEBKGND
message so I can't see how to check for this :-(
Adding an "OnPaint()" directly on the end of OnInitDialog
() doesn't help. Short term,I've had to resort to calling
OnPaint() from within a timer for a short period after
dialog is created ... clearly wrong but what else is
there ?
In one particular dialog, I am calling OnPaint() a total
of THREE times during initialisation yet still the stuff
I'm painting doesn't appear.
It may be a timing issue as I've had a bug report that one
of the dialogs in my app doesn't display a picture on a
paticular PC 50% of the time, and I've just encountered
the problem here on another dialog after adding some
seemingly innocent code (which could only mean its timing
related?).
Have I missed something important to do with painting on
dialogs ?
All's I can think off is that some kind of background
erase is going on without a following WM_PAINT ... trouble
is for some reason dialogs don't have a WM_ERASEBKGND
message so I can't see how to check for this :-(
Adding an "OnPaint()" directly on the end of OnInitDialog
() doesn't help. Short term,I've had to resort to calling
OnPaint() from within a timer for a short period after
dialog is created ... clearly wrong but what else is
there ?