Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with WM_PAINT

Status
Not open for further replies.

oaw

Programmer
Oct 28, 2003
1
0
0
NO

When I have been using the program for a while, the graphics really messes up. All fonts,pen and brush get wrong.

Could have something to do with the device context, or the graphical object I create/delete.

(I think the program messes up when the WM_PAINT message has run about 100 times).

 
Sounds like you are loosing graphics resources. Make sure you reselect in the original pens, brushes, ... etc before exiting your paint function. Also if you use GetDC anywhere you need to use ReleaseDC.

Hope this helps.
 
I had the same problem. Revert to stock objects (brushes, pens) and delete created objects *before* closing the DC. That will do it.

See here: thread713-686470
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top