求教····
为何这段代码加到Ondraw函数中还不能实现画出格子?pDC->SelectStockObject(BLACK_PEN);
CPoint pointA,pointB;
pointA.x = pDoc->pointBegin.x;
pointA.y = pDoc->pointBegin.y;
pointB.x = pDoc->pointBegin.x+pDoc->nDistance*18;
pointB.y = pDoc->pointBegin.y;
for(int i=0;i<17;i++)//画横线
{
pointA.y+=pDoc->nDistance;
pointB.y+=pDoc->nDistance;
pDC->MoveTo(pointA);
pDC->LineTo(pointB);
}
pointA.y=pDoc->pointBegin.y;
pointB.x=pDoc->pointBegin.x;
pointB.y=pDoc->pointBegin.y+pDoc->nDistance*18;
for(i=0;i<17;i++)//画竖线
{
pointA.x+=pDoc->nDistance;
pointB.x+=pDoc->nDistance;
pDC->MoveTo(pointA);
pDC->LineTo(pointB);
}