If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

OnPaint() not being called for CWnd

Hello,

I have a CWnd class, that is a child to another CWnd. The problem is that onPaint() is never invoked. Even when I call UpdateTest(), and the Invalidate() gets called, OnPaint() still does not get called. If I explicitly call OnPain() instead of Invalidate() it works. Anyone know what my problem is?

Re: OnPaint() not being called for CWnd

Re: OnPaint() not being called for CWnd

Originally Posted by ekhule

I think I figured it out. I was missing #include "afxwin.h"

Please explain why and how including a certain C++ #include file during compilation fixes a runtime problem.

I think you needed to recompile your entire application, as some object modules may not have been up to date. It has nothing to do with the include file, since include files are only there for compilation purposes, not runtime purposes.