首先在视图类(或框架类)中添加一个CPoint m_pt的成员变量,然后在视图类中添加鼠标左击消息处理WM_LBUTTONDOWN即为:
void CMy48View::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_pt=point;
CView::OnLButtonDown(nFlags, point);
}这样就将鼠标左键的点保存在m_pt中了