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.
构造函数如下: CLine::CLine(CPoint ptFrom, CPoint ptTo,COLORREF crColor) { //initialize the from and to points m_ptFrom=ptFrom; m_ptTo=ptTo; m_crColor=crColor; }如何改?
'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.
CLine::CLine(CPoint ptFrom, CPoint ptTo,COLORREF crColor)
{
//initialize the from and to points
m_ptFrom=ptFrom;
m_ptTo=ptTo;
m_crColor=crColor;
}如何改?