![]() |
#2
guer1682010-12-06 23:13
|

BOOL CMy11_30_1View::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
CDC dcCompatible;
dcCompatible.CreateCompatibleDC(pDC);
dcCompatible.SelectObject(&bitmap)
CRect rect;
GetClientRect(&rect);
pDC->BitBlt(0,0,rect.Width(),rect.Height(),&dcCompatible,0,0,SRCCOPY);
return TRUE;
}
里为什么会出来现rect没有定义呢!?{
// TODO: Add your message handler code here and/or call default
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
CDC dcCompatible;
dcCompatible.CreateCompatibleDC(pDC);
dcCompatible.SelectObject(&bitmap)
CRect rect;
GetClientRect(&rect);
pDC->BitBlt(0,0,rect.Width(),rect.Height(),&dcCompatible,0,0,SRCCOPY);
return TRUE;
}
e:\program files\vc98\mfc\include\afxwin.h(225) : see declaration of 'CRect'
G:\VC\11_30_1\11_30_1View.cpp(236) : error C2065: 'rect' : undeclared identifier
G:\VC\11_30_1\11_30_1View.cpp(238) : error C2228: left of '.Width' must have class/struct/union type
G:\VC\11_30_1\11_30_1View.cpp(238) : error C2228: left of '.Height' must have class/struct/union type
执行 cl.exe 时出错.
11_30_1.exe - 1 error(s), 0 warning(s)