MFC Learning CDC & HDC

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.