I have an object, dc, of type CDC and I'd like to get an HDC object.
I read the MSDN documentation here, but don't really understand it.
Can someone provide me with a brief example/explanation on how to do this?
When you have CDC
object it will be implicitly converted to HDC
when necessary:
CDC dc;
HDC hdc = dc; // HDC hdc = dc.operator HDC();
If you have pointer to CDC
object then using function GetSafeHdc
will look more clear:
CDC* pdc = SOME;
HDC hdc = pdc->GetSafeHdc();