E:\my project\Day10\Line.cpp(15) : error C2512: 'CLine' : no appropriate default constructor available
Error executing cl.exe.指向->IMPLEMENT_SERIAL(CLine,CObject,1)

解决方案 »

  1.   

    Compiler Error C2512
    'identifier' : no appropriate default constructor availableNo default constructor was available for the specified class, structure, or union.The compiler will supply a default constructor only if user-defined constructors are not provided. If you provide a constructor that takes a nonvoid parameter, then you must also provide a default constructor. The default constructor can be called with no parameters, that is, a constructor with default values for all parameters.
      

  2.   

    构造函数如下:
    CLine::CLine(CPoint ptFrom, CPoint ptTo,COLORREF crColor)
    {
      //initialize the from and to points
    m_ptFrom=ptFrom;
    m_ptTo=ptTo;
    m_crColor=crColor;
    }如何改?