HDC 和CDC 类型有什么区别?

解决方案 »

  1.   

    CDC dc(this);
    HDC hdc;
    hdc =dc->m_hdc;
      

  2.   

    HDC hdc;
    hdc是一个句柄,它可以指向一个系统对象
    CDC dc;
    CDC是一个类,dc是它的一个对象,这个类是
    专门用于封装HDC的,比如可以这样
    dc.Attach(hdc);
    接着就可以通过dc来操作那个系统对象了
      

  3.   

    HDC是一个句柄 ,this property returns a handle provided by Windows CE to the device context of an object.CDC是一个类, CDC class defines a class of device-context objects. The CDC object provides member functions for working with a device context, such as a display or printer, as well as members for working with a display context associated with the client area of a window.