Microsoft
Software
Hardware
Network
Question : How to access class due to 'cannot instantiate abstract class' error
This code in the cpp:
LMObject pObj;
MObject::MObject(LMAttrHol
der(pObj))
;
Generates this error in the compiler:
error C2259: 'MObject' : cannot instantiate abstract class
due to following members:
'LMClassFactory MObject::GetFactory(void) const' : is abstract
(244) : see declaration of 'MObject::GetFactory'
'LMObject MObject::Duplicate(DUP_FLA
GS)' : is abstract
(262) : see declaration of 'MObject::Duplicate'
'void MObject::Draw(HDC,DRAWFLAG
S,const CRect *)' : is abstract
(265) : see declaration of 'MObject::Draw'
These are clearly virtual in the header file, as are some of the base class (though not all of that base class). So how fix that error?
Answer : How to access class due to 'cannot instantiate abstract class' error
>> MObject::MObject (LMAttrHolder lpAttr)
>> {
>> }
If that is all the constructor does then I see no problem with the change you made and I am left wondering what the point of the original code was as it seems completely pointless. :)
Random Solutions
read pdf from blob column write to file
How do I run rsync without it hogging resources?
Indesign CS5 overset text problem
How to read the last line of a Text file
Access Error Code 2302
What Are Some Options to Search for Statistical Information Not Typically in Google-Type Searches?
VSS Snapshot warning. File c:\windows\system32\vmbusp
ipe.dll is not present
Error: SQLSTATE[24000]: Invalid cursor state
iPhone, how do I correctly pass data model object data between various view controllers without breaking MVC?
Terminal command to assign an IP address to a device