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?
Just assign it. CDC cdc = something. HDC hdc = cdc; if (hdc != 0) { //success... }
Interferon-producing plasmacytoid dendritic cells (pDC) are a specialized branch of the dendritic cell (DC) family, and their differentiation in mice is closely linked to that of conventional DC (cDC).
MFC provides a class called CDC that encapsulates a HDC, which is a handle to a Windows device context object. All operations with a device context should be made through such such a CDC object.
HDC is the data type for a device context handle.
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();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With