CreateCompatibleBitmap() from Un-released DC

Oct 12, 2014 at 6:54am
Hey there,
I just tracked down a bug within my source code, where my use of CreateCompatibleBitmap() is returning NULL.

I have a hunch that it is because I haven't released the DC, before trying to use it to create a bitmap.

If a DC is not released, can you still create a bitmap from it?

NOTE: The device context in question is not a WindowDC, it's a PrivateDC. Hence, the reason I didn't release it.
Oct 12, 2014 at 9:55am
If a DC is not released, can you still create a bitmap from it?


Yes. Are you sure the DC handle is valid?
Oct 12, 2014 at 11:05am
What exactly is a "PrivateDC" ? Where does it came from ? It is a class ?
Oct 12, 2014 at 2:25pm
It belongs to a class.
Similar to that of a BackBuffer.
Topic archived. No new replies allowed.