error C2065: 'GetDocument' : undeclared identifier
代码如下:
class CTest5Doc:public CDocument
{
protected:
CRect m_rect;
DECLARE_MESSAGE_MAP()
public:
CTest5Doc();
};
CTest5Doc::CTest5Doc()
{
m_rect.left=0;
m_rect.right=100;
m_rect.top=550;
m_rect.bottom=600;
}
void CWindow::Draw (CDC& dc)
{
CTest5Doc* pDoc=GetDocument();
ASSERT_VALID(pDoc);
pDC->Rectangle(pDoc->m_rect);
}
但编译出现:error C2065: 'GetDocument' : undeclared identifier
想问一下这是为什么?
麻烦了~~