Why do not call cdialogcwndonpaint() for painting messages

http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/b688fe19-8517-473e-9183-83289f650281 

Several things happen behind the scenes with CPaintDC. Its constructor calls BeginPaint, which issues an erase background message.  So creating two CPaintDC causes interference between them.  You can read about the BeginPaint/EndPaint APIs for more understanding of erasing and clipping.


If you want to paint in derived classes and base classes do it the way MFC does with CView.  Create the CPaintDC only one time and place and pass it by reference to descendant classes using something like OnDraw(CDC* pDC)

Powered by Jekyll and Theme by solid

本站总访问量