MFC: OnPaint Method only called once, why?

Started by
1 comment, last by geekyware 12 years, 7 months ago
Hi

I'm using MFC (first time using it) and I've got some code inside the dialogue's OnPaint method I want to debug.

When the program loads the breakpoint is obviously hit, pressing run the breakpoint is not hit again (its at the top of the function on generated code that should always hit)

Does anyone know why it does not seem to call again after the first time

Thanks
Advertisement
- The window isn't being told to repaint via resize, invalidate() or similar.
- The controls paint themselves.

If you want to force a paint, a quick and easy way is: look up SetTimer - Use it to create a timer, and an OnTimer event for your dialog, then in the OnTimer call Invalidate(true);
Just to make sure that it's something about the code, and not the breakpoints system, could you put something like
printf("whatever..."); there to see if it really runs only once?

This topic is closed to new replies.

Advertisement