i have this class:
i have tried this as the operator=PHP Code:class SubclassedObject {
public:
MessageAnswer MsgResponse; //
SubclassedObject operator= (SubclassedObject);
LRESULT CALLBACK SubclassWndProc(HWND hwnd, UINT Message, WPARAM wParam,
LPARAM lParam);
};
but it gives me errors such as therePHP Code:SubclassedObject SubclassedObject::operator = (SubclassedObject sobj)
{
this->MsgResponse = sobj.MsgResponse;
this->SubclassWndProc = sobj.SubclassWndProc;
return this;
}
can anyone help me? thanksCode:c:\my documents\subclasspractice\easysubclass.h(46) : error C2659: '=' : overloaded function as left operand c:\my documents\subclasspractice\easysubclass.h(47) : error C2664: '__thiscall SubclassedObject::SubclassedObject(const class SubclassedObject &)' : cannot convert parameter 1 from 'class SubclassedObject *const ' to 'const class SubclassedObject &' Reason: cannot convert from 'class SubclassedObject *const ' to 'const class SubclassedObject' No constructor could take the source type, or constructor overload resolution was ambiguous c:\my documents\subclasspractice\easysubclass.h(47) : error C2553: no legal conversion of return value to return type 'class SubclassedObject *'




Reply With Quote