Does it matter when you release the DC

Started by
3 comments, last by dustydoodoo 19 years, 6 months ago
Well i found this tutorial on gametutorials and on the example he uses ReleaseDC() at the end of winmain, and then i did it and released the dc in winProc. Because i was wondering how it can still draw on the screen when the dc is released? all my drawing funcions are in winProc.
Sure i will write my signature, just gimme a piece of paper
Advertisement
ReleaseDC doesn't really kill the device context, it just releases the device context handle your program is using so the system can do what it wants with the device context, and kills the handle (though due to the fact that the memory is probably not overwritten you can probably use the handle anyway, though you shouldn't. Or you can GetDC it again). DeleteDC really kills device contexts and should never be used on a device context acquired via GetDC, though I think it will just return an error rather than crashing iirc.

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
Well this is off topic but I had no idea what iirc was so I googled for all those who didn't know what it meant. It is an acronym for "if i read correctly"
Just thought I'd clear that up for people like me :)
Sorry for going off topic,
-Goten
Actually most common usage is "if i remember correctly", as here.

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
Ok thanks!
Sure i will write my signature, just gimme a piece of paper

This topic is closed to new replies.

Advertisement