基于 MFC 编程,出现了几个错误,求大神指教!
程序代码:
void CRuingcarView::OnDraw(CDC* pDC) { CRuingcarDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if(m_vchang==0&&m_vkuan==0) if(dlg.DoModal()==IDOK) {m_vchang=dlg.m_chang; m_vkuan=dlg.m_kuan; } // TODO: add draw code for native data here CClientDC dc(this); dc.Rectangle(10,10,m_vchang,m_vkuan); CBitmap Bitmap; Bitmap.LoadBitmap(IDB_BITMAP1); CDC MemDC; MemDC.CreateCompatibleDC(pDC); CBitmap*OldBitmap=MemDC.SelectObject(&Bitmap); BITMAP bm; Bitmap.GetBitmap(&bm); pDC->BitBlt(x,y,bm.bmWidth,bm.bmHeight,&MemDC,0,0,SRCCOPY); pDC->SelectObject(OldBitmap); }错误
:\VC++\Ruingcar\RuingcarView.cpp(64) : error C2065: 'dlg' : undeclared identifier
F:\VC++\Ruingcar\RuingcarView.cpp(64) : error C2228: left of '.DoModal' must have class/struct/union type
F:\VC++\Ruingcar\RuingcarView.cpp(65) : error C2228: left of '.m_chang' must have class/struct/union type
F:\VC++\Ruingcar\RuingcarView.cpp(66) : error C2228: left of '.m_kuan' must have class/struct/union type
Error executing cl.exe.