这个“画线”如何这么慢,是小弟我代码有关问题,还是电脑有关问题

这个“画线”怎么这么慢,是我代码问题,还是电脑问题。
C/C++ code

void CDrawView::OnLButtonDown(UINT nFlags, CPoint point) 
{
    // TODO: Add your message handler code here and/or call default
//    MessageBox("我是中国人!");
    beginP=point;           
    CView::OnLButtonDown(nFlags, point);
}

//DEL void CDrawView::OnRButtonDown(UINT nFlags, CPoint point) 
//DEL {
//DEL     // TODO: Add your message handler code here and/or call default
//DEL     MessageBox("View Clock");
//DEL     CView::OnRButtonDown(nFlags, point);
//DEL }

void CDrawView::OnLButtonUp(UINT nFlags, CPoint point) 
{
    // TODO: Add your message handler code here and/or call default
    HDC hdc;
    hdc=::GetDC(m_hWnd);
    MoveToEx(hdc,beginP.x,beginP.y,NULL);
    LineTo(hdc,point.x,point.y);
    CView::OnLButtonUp(nFlags, point);
}



出来一个界面之后,我能够画线,但是反应的速度很慢,在鼠标拖动之后,要一到两秒,线段才会显示出来。

还有一个问题。
就是CView::OnLButtonUp(nFlags, point);
这个函数是什么作用呢?


------解决方案--------------------
OnLButtonUp:鼠标弹起。。。。。。
------解决方案--------------------
void CDrawView::OnLButtonDown(UINT nFlags, CPoint point) 
{
// TODO: Add your message handler code here and/or call default
// MessageBox("我是中国人!");
beginP=point;
// CView::OnLButtonDown(nFlags, point);//去掉这句默认的试试
}

void CDrawView::OnLButtonUp(UINT nFlags, CPoint point) 
{
// TODO: Add your message handler code here and/or call default
HDC hdc;
hdc=::GetDC(m_hWnd);
MoveToEx(hdc,beginP.x,beginP.y,NULL);
LineTo(hdc,point.x,point.y);
// CView::OnLButtonUp(nFlags, point);//去掉这句默认的试试
}
也就是在两个函数里把默认的响应函数去掉,直接执行你的代码



------解决方案--------------------
你用的是WIN7吧?
在WIN7下LineTo存在Bug,这个微软已经公布了。但是,我打上了微软的补丁后,还是不行,微软也说还有待测试。

如果是新写的程序,你画完线,在画个点,就可以触发了。
如果还有问题,可以找我就这个问题探讨一下。
qq 56616197