Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. IMPLEMENT_DYNCREATE(class, base class)

IMPLEMENT_DYNCREATE(class, base class)

Scheduled Pinned Locked Moved C / C++ / MFC
c++comhelptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JennyP
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • J 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! JennyP

      P Offline
      P Offline
      Philippe Mori
      wrote on last edited by
      #2

      At 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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups