IMPLEMENT_DYNCREATE(class, base class)
-
Hello, I'm trying to implement the "Simple and Easy Undo/Redo By Keith Rule" (http://www.codeproject.com/docview/undo.asp#xx91553xx) which instructs to make the Document Class inherit (in addition to CDocument) CUndo:
class CGoalsDoc : public CDocument, public CUndo
However, upon compile, I get an error: ...\goalsdoc.cpp(18) : error C2259: 'CGoalsDoc' : cannot instantiate abstract class due to following members: ...\goalsdoc.h(21) : see declaration of 'CGoalsDoc' My IMPLEMENT_DYNCREATE macro reads:IMPLEMENT_DYNCREATE(CGoalsDoc, CDocument)
IMPLEMENT_DYNCREATE doesn't allow me to insert "CDocument, CUndo" in the second parameter. I'm not too familiar with the VC++ wizard's reasons for using these macros. Does anyone have a hint on how to get around this? Thanks! JennyP -
Hello, I'm trying to implement the "Simple and Easy Undo/Redo By Keith Rule" (http://www.codeproject.com/docview/undo.asp#xx91553xx) which instructs to make the Document Class inherit (in addition to CDocument) CUndo:
class CGoalsDoc : public CDocument, public CUndo
However, upon compile, I get an error: ...\goalsdoc.cpp(18) : error C2259: 'CGoalsDoc' : cannot instantiate abstract class due to following members: ...\goalsdoc.h(21) : see declaration of 'CGoalsDoc' My IMPLEMENT_DYNCREATE macro reads:IMPLEMENT_DYNCREATE(CGoalsDoc, CDocument)
IMPLEMENT_DYNCREATE doesn't allow me to insert "CDocument, CUndo" in the second parameter. I'm not too familiar with the VC++ wizard's reasons for using these macros. Does anyone have a hint on how to get around this? Thanks! JennyPAt first, I would think that IMPLEMENT_DYNCREATE must be in the most derived class (since one purpose of the macro is to allows dynamic creation of the document). Also all pure virtual functions from CUndo have to be defined in that class (or any intermediate class between CUndo and the concrete class). You should probably only put CDocument in the second macro parameter. Philippe Mori