Tag Archives: The standard c + +

Error c2259 cannot instance abstract class due to following members

Error description:
E:/mywork/1.7 sp1/ginfo/client/SRC/skdesigner/dsgquerydlg. H. (295) : error C2259: ‘CDsgFormatDataMgrDlg’ : Always instantiate the abstract class due to the following members:
e:/mywork/1.7 sp1/ginfo/client/SRC/skdesigner/dsgformatdatamgrdlg. H (14) : see declaration of ‘CDsgFormatDataMgrDlg’
 
Reason for error:
An implementation class inherits an abstract base class, but does not implement all the methods in the abstract base class.
 
Can be similarly implemented:
Virtual Void EnableControl(PSKOPEROBJECT Lpoo, BOOL bEnable) {}//
 
Code example:
 
class CDsgFormatDataMgrDlg : public CDialogImpl< CDsgFormatDataMgrDlg> ,
public ISkBusinessEngineSink// abstract base class
{
public:
enum {IDD = IDD_FORMATDATAMGR_DLG};

CDsgFormatDataMgrDlg ();
virtual ~ CDsgFormatDataMgrDlg ();
virtual BOOL PreTranslateMessage(MSG* pMsg);

}
 
The class ISkBusinessEngineSink
{
public:
virtual void HandleOneCSObject (LPCTSTR lpszName) {}
virtual BOOL HandleUpdateCalendarResult (int nType, PCALENDAREVENT lpce,
DWORD dwClientTmpId, BOOL bRet, DWORD dwErrorCode) {return FALSE; }
virtual BOOL HandleUpdateDesktopResult (int nType, PDESKTOPITEM lpdi,
DWORD dwClientTmpId, BOOL bRet, dwords dwErrorCode) = 0.

virtual void HandleHotBUList(PHOTBU LPHB, int nCount) {}
virtual void OnDBFuncReady(BOOL bReady) = 0;
virtual void OnDBViewReady(BOOL bReady) = 0;
virtual void OnSNReady(BOOL bReady) = 0;
virtual void OnTableReady(BOOL bReady) = 0;

}
 
Methods in the abstract base class must fully implement…
Appendix:
The choice of http://www.cnblogs.com/shenfx318/archive/2007/01/25/630760.html (abstract base classes and interfaces) and the difference between
http://www.cnblogs.com/TravelingLight/archive/2010/06/02/1750073.html (abstract base class for some of the problems)
http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Companion/cxx_crib/interfaces.html
(OO concepts and abstract classes and interfaces)