我仿照vc++的书上的例子画一个圆,很简单,添加的程序如下红色字体:
void CLiuView::OnDraw(CDC* pDC)
{
pDC->TextOut(0,0,"hello");
pDC->SelectStockObject(GRAY_BRUSH);
pDC->Ellipse(CRect(0,20,100,120));
}
但是在visual studio 2005中加入上述代码就构建不了,总是出现如下错误:
.\LXMView.cpp(50) : error C2065: 'pDC' : undeclared identifier
.\LXMView.cpp(50) : error C2227: left of '->TextOutW' must point to class/struct/union/generic type
type is ''unknown-type''
.\LXMView.cpp(51) : error C2227: left of '->SelectStockObject' must point to class/struct/union/generic type
type is ''unknown-type''
.\LXMView.cpp(52) : error C2227: left of '->Ellipse' must point to class/struct/union/generic type
type is ''unknown-type''
Generating Code...
请问各位高手这是什么原因在啊?