在VS下调试出现4个错误:错误 1 error C2259: “ATL::CComObject<Base>”: 不能实例化抽象类 c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlcom.h错误 2 error C2660: 函数不接受 0 个参数错误 3 error C2660: 函数不接受 0 个参数错误 4 error C2227: “->Count”的左边必须指向类/结构/联合/泛型类型最好转为VS的,谢谢
源码地址:http://download.csdn.net/detail/aisniper/4347688

解决方案 »

  1.   

    看了你的源代码,那叫一个乱哟. ICimPickToolImpl 接口就是个搅屎棍,还不赶紧删了? 全文搜索,找到一个删一个.
      

  2.   

    vc6:
    D:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE\atlcom.h(2440) : error C2259: 'CComObject<class CCimPickToolImpl>' : cannot instantiate abstract class due to following members:
    //
    CimPickTool.dll - 5 error(s), 26 warning(s)
      

  3.   

    哎,菜鸟小白,加强修炼哟! 给你修整的结果.http://download.csdn.net/detail/xierenhui/4348054
      

  4.   

    5楼的没错误。http://download.csdn.net/detail/xierenhui/4348054
      

  5.   


    感谢大哥的帮助,代码编译通过了。但实际应用这个DLL时有问题。
    会在这里出现死循环。请问是什么原因引起的
    while (1)
    {
    while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
    ///////////////////这里出现死循环//////////////////////////
    {
    if (msg.message == WM_QUIT) {
    hr = S_FALSE;
    goto __EXIT_POINT__;
    } TranslateMessage(&msg);
    DispatchMessage(&msg);  if (pPickTool->m_CEvent.Lock(0) != 0)
     {//Will be True when selection done or moise middle button pressed then m_CEvent made signaled
    aToolCont->PopTool(pPickTool);//Deactivate PickTool
    IsPoped = true;
    break ;
     }
    }
    if (IsPoped)
    break ;
    }
      

  6.   

    PeekMessage 就是个消息循环啊, 你关闭窗口时会执行到 "if (msg.message == WM_QUIT)" 里面吗?
      

  7.   

    进入 PeekMessage 死循环之前, 必须先创建一 WS_OVERLAPPEDWINDOW 风格的窗口, 这样, 这个死循环就可以顺利退出了. 
    如果还不懂, 就只能推荐你去看 <<Programing Windows>> 编程书了.
      

  8.   

    非常感谢xierenhui大哥的帮助。