The CClientDC class is derived from CDC and takes care of calling the Windows functionsGetDC at construction time andReleaseDC at destruction time. This means that the device context associated with a CClientDC object is the client area of a window.from MSDNThat's mean you can
CClientDC(pWnd);
but you can NOT use this
CDC(pWnd);
CClientDC(pWnd);
but you can NOT use this
CDC(pWnd);
解决方案 »
- vc active控件问题
- select多线程的问题
- ADO连数据库,断后重连?
- 流文件有关
- 谁可以提供一个sqlserver2000的扩展存储过程的样列?
- RawHtmlDlg.obj : error LNK2001: unresolved external symbol __imp__InternetReadFile@16
- 程序在正常的简体操作系统上没有错误,在繁体操作系统上出现引数错误时为什么!求大神帮忙!
- vc如何调用远程ACCESS数据库?
- 以下错误是在release版本时出错的,debug版本正确!
- 想用DAO将MDB中的数据导出成XLS格式,该如何做?
- 我写了一个FTP程序,想在上载前将待上载的所有文件压缩成一个包,有何简单的办法,或者说有什么含数是压缩文件的
- mshtml的一个问题。我如果才能获得往head部分写一行html
而CClientDC类是从CDC派生,封装了与“窗口客户区”相关的显示DC,其构造函数调用了GetDC函数,而析构函数调用了ReleaseDC函数。
简单的CDC实现例子
TEXTMETRICtm; //存放字体信息的结构
CDC* pDC=GetDC();
pDC->GetTextMetrics(&tm); //获取当前系统的字体信息
简单的CClientDC实现例子
CClientDC dc(this); //在当前窗口中创建CClientDC对象
CRect myRect;
GetClientRect(&myRect); //获得当前客户区信息赋予myRect
dc.Ellipse(myrc); //用CClientDC对象绘制一个椭圆,改椭圆充满客户区窗口
CClientDC
CWindowsDC
CPaintDC
好好学习,天天向上