Jump to content
  • Advertisement
Sign in to follow this  
DanielDoyle

MFC: OnPaint Method only called once, why?

This topic is 2532 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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);

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!