1. Definition
CDC * PDC; HDC HDC;
2. Explanation
HDC is a data type for Windows and is a device description handle.
The CDC is a class in MFC that encapsulates almost all of the operations on HDC.
The variables defined by HDC point to a piece of memory, which is used to describe the related contents of a device, so it can also be assumed that the HDC defines a pointer;
The CDC class defines an object that has a device description table defined by the HDC, and also contains functions related to the HDC operation.
3. Get
<pre name= "code" class= "CPP" ><pre name= "code" class= "CPP" >CDC * pdc;hdc HDC;PDC = GetDC (); HDC = pdc-> GETSAFEHDC ();
4. Conversion
cdc* pdchdc Hdc;pdc=attach (HDC); The PDC is a class pointer Hdc=getsafehdc (PDC); HDC is a Windows handle
5. Other
This is a pointer to the DC Output target window, through which you can get the window handle, object with parameter construction What's so strange about that? CPAINTDC Invalid zone DC, equivalent to BeginPaint, endpaint cclientdc client area DC, equivalent to GetDC, ReleaseDC cwindowdc full window DC, equivalent to GETWINDOWDC, ReleaseDC CDC any DC, equivalent to CreateDC, DeleteDC
MFC Learning CDC & HDC