local function definitions are illegal这种错误怎么解决?????
E:\programe\c++\MSDev98\MyProjects\Hzbh\HzbhView.cpp(164) : error C2601: 'DrawBkGrid' : local function definitions are illegal
该函数如下:
void CHzbhView::DrawBkGrid(CDC *pDC)
{
int x_line;
int PixelNum=12;
int GridNumber=40;
CPoint m_start_point(8,8);
pDC->MoveTo(m_start_point);
for(x_line=0;x_line<=40;x_line++){
pDC->MoveTo(m_start_point.x,
m_start_point.y+x_line*PixelNum);
pDC->LineTo(m_start_point.x+PixelNum*GridNumber,
m_start_point.y+x_line*PixelNum);
}
for(x_line=0;x_line<=40;x_line++){
pDC->MoveTo(m_start_point.x+x_line*PixelNum,
m_start_point.y);
pDC->LineTo(m_start_point.x+x_line*PixelNum,
m_start_point.y+PixelNum*GridNumber);
}
}
此函数定义我是照书抄的.它是一个类函数,怎么错误中说是局部函数定义有问题呢?