小弟初学C++,用vs2010编译
最近遇到一个棘手的问题,用vs2010先建立一个mfc,我想在CView下增加鼠标左键按下抬起事件,来画一条直线。OnLButtonDown,OnLButtonUp.内容及其简单不过发现问题,任意编码后,只要一修改,执行,就会出现link1168错误,检查任务管理器中没有运行程序存在。这样反复多次,没有办法,来这里求助,请教各位高手指点,越详细越好,因为本人新手,很多都不清楚。再次感谢

解决方案 »

  1.   

    跟代码没关系啊
    // CDrawView 消息处理程序
    void CDrawView::OnLButtonDown(UINT nFlags, CPoint point)
    {
    // TODO: Add your message handler code here and/or call default
    m_pn=point;
    //CView::OnLButtonDown(nFlags, point);
    }
    void CDrawView::OnLButtonUp(UINT nFlags, CPoint point)
    {
    // TODO: Add your message handler code here and/or call default
    CClientDC dc(this);
    dc.MoveTo(m_pn);
    dc.LineTo(point);
    //CView::OnLButtonUp(nFlags, point);
    }
    这是代码,换了别的代码也是这样
      

  2.   

    1168号的错误是:Element   not   found.   查看文件是否存在,而且查看一下编译输出的路径等,确认该程序是否已经运行,检查完后,Rebuild   All
      

  3.   

    我新建一个hello win32 console程序 
    #include<iostream>
    using namespace std;int main()
    {
    cout<<"hello"<<endl;
    return 0;
    }
    运行没问题:
    加上一个变量
    #include<iostream>
    using namespace std;int main()
    {
    int a=0;
    cin>>a;
    cout<<"hello"<<endl;
    return 0;
    }
    link 1168错误。改回去,还是1168错误,rebuild,clean都不行。查看下国外的网站,有这个问题,但没有解决,都是在win7下出现的,我的也是win7