Sign in to follow this  
dustydoodoo

Does it matter when you release the DC

Recommended Posts

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.

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this