5. Add the folowing member variables:
………………
DECLARE_MESSAGE_MAP()
public:
int x;
int y;
};
Var name Var type Class Access type
x int CLineView public
y int CLineView public
6. • Initialize the var in the constructor of the
CLineView class:
CLineView::CLineView() noexcept
{
// TODO: add construction code here
x = 0;
y = 0;
}
7.
8.
9.
10. void CLineView::OnLButtonDown(UINT nFlags,
CPoint point)
{
// TODO: Add your message handler code here
//and/or call default
CClientDC dc(this);
dc.MoveTo(x, y);
dc.LineTo(point.x, point.y);
x = point.x;
y = point.y;
CView::OnLButtonDown(nFlags, point);
}