Device Context Confusion
- From: eepcat <eepcat@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 3 Dec 2007 10:36:02 -0800
Hello,
In the course of debugging some memory leaks, I noticed that my graphics
routines were rather inconsistent. Sometimes I ReleaseDC( ), then
DeleteObject( ) on the drawing resources; sometimes vice versa. The examples
I see throughout forums and MSDN proper also show inconsistent ordering.
So, suppose I create:
1 Pen, 1 Brush, 1 Font, 1 Compatible Bitmap within a function. At the end
of this function, what is the proper cleanup?...
Delete the drawing resources first, then ReleaseDC()? Vice versa?
Sometimes I've seen DeleteDC() rather than ReleaseDC(). I want to structure
the cleanup properly so that I can eliminate this situation as a cause of
resource leaks.
Thanks to all,
- eep!
.
- Follow-Ups:
- Re: Device Context Confusion
- From: voidcoder
- Re: Device Context Confusion
- Prev by Date: Re: about startup problem
- Next by Date: Re: is 'finally' a reserved word in windows CE in a C program?
- Previous by thread: Re: about startup problem
- Next by thread: Re: Device Context Confusion
- Index(es):
Loading