|
void CCalendarView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CDC *pDC = GetDC();
CDrawUI* pDraw = new CDrawUI;
RECT rect;
rect.left = START_X;
rect.top = START_Y;
rect.bottom = START_X + 100;
rect.right = START_Y + 50;
pDraw->DrawRect(rect,pDC); //错误定位到这里
}
error C2664: 'DrawRect' : cannot convert parameter 2 from 'class CDC *' to 'class CDC'
void CDrawUI::DrawRect(RECT rect,CDC *pDC)
{
CBrush pTitleBrush(TITLE_BKCLR);
CBrush *pOldBrush = pDC->SelectObject(&pTitleBrush);
pDC->Rectangle(&rect);
pDC->SelectObject(pOldBrush);
ReleaseDC(pDC);
} |
|