Re: MESSAGE_HANDLER(WM_PAINT, OnPaint) vs MSG_WM_PAINT(OnPaint)

"cmostler" <[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
--- In [email protected], "Igor Tandetnik" <itandetnik@...> wrote:
> "cmostler" <Chris.Ostler+yahoo.com@...> wrote:
> > In doing so, I found that if I handle the WM_PAINT message using the
> > MSG_WM_PAINT macro (and associated handler function), the application
> > will completely utilize a single CPU, continuously processing
> > WM_PAINT messages.  However, if I use the MESSAGE_HANDLER macro for
> > the WM_PAINT message, the CPU remains idle, as expected.
> 
> The difference is not in the macros, but in your handler. I bet when you 
> handle MSG_WM_PAINT you are trying to use HDC passed to you as a 
> parameter (which is actually NULL most of the time), while in your 
> MESSAGE_HANDLER-based hander you call BeginPaint and EndPaint (as you 
> should).

That was it, alright.  The wizard generated code was creating a CPaintDC (and doing nothing), while I was just doing nothing.  Thanks for the help!



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.