请教:MFC中Onpaint函数造成内存增加的原因?
void CInterFaceDlg::OnPaint(){
CPaintDC dc(this); // device context for painting
// TODO: 在此处添加消息处理程序代码
CDC* pDC = &dc; //获取设备句柄
HDC hDc=pDC->m_hDC;
CRect rect;
GetClientRect(&rect);
CDC dcMem;
CBitmap m_pBitmap;
dcMem.CreateCompatibleDC(&dc);
m_pBitmap.CreateCompatibleBitmap(pDC,rect.Width(),rect.Height());
dcMem.SelectObject(&m_pBitmap);
dcMem.FillSolidRect(rect,RGB(255,255,255));
CBrush brushBlue3(RGB(0,0,0));
dcMem.SelectObject(&brushBlue3);
Rectangle(dcMem.m_hDC,160,203,160+PosProg,213);
pDC->BitBlt(0,0,rect.Width(),rect.Height(),&dcMem,0,0,SRCCOPY);
dcMem.DeleteDC();
m_pBitmap.DeleteObject();
// 不为绘图消息调用 CDialog::OnPaint()
}