读书人

请问 OnPrepareDC 的使用

发布时间: 2012-04-17 15:06:33 作者: rapoo

请教 OnPrepareDC 的使用
这是我的代码

C/C++ code
void CMyTestDlg::OnMouseMove(UINT nFlags, CPoint point){    // TODO: Add your message handler code here and/or call default    if(bcapture)      {          CClientDC dc(this);          OnPrepareDC(&dc);           //error C3861: 'OnPrepareDC': identifier not found        CRect oldrc(pt,size);          InvalidateRect(oldrc,TRUE);          pt=point-offsetsize;          CRect newrc(pt,size);          InvalidateRect(newrc,TRUE);      }      CDialog::OnMouseMove(nFlags, point);}


我想移动对话框上的图片,这是OnMouseMove函数,提示onpreparedc出错,求指点。

[解决办法]
onpreparedc是为打印功能服务的消息函数
你为什么要这么用
你这个位置通过GetDC获取即可

读书人网 >VC/MFC

热点推荐