Export (0) Print
Expand All
MFC
TRY
Expand Minimize

DECLARE_DYNCREATE 

Enables objects of CObject-derived classes to be created dynamically at run time.


DECLARE_DYNCREATE(class_name )

Parameters

class_name

The actual name of the class.

The framework uses this ability to create new objects dynamically. For example, the new view created when you open a new document. Document, view, and frame classes should support dynamic creation because the framework needs to create them dynamically.

Add the DECLARE_DYNCREATE macro in the .h module for the class, then include that module in all .cpp modules that need access to objects of this class.

If DECLARE_DYNCREATE is included in the class declaration, then IMPLEMENT_DYNCREATE must be included in the class implementation.

For more information on the DECLARE_DYNCREATE macro, see CObject Class Topics.

NoteNote

The DECLARE_DYNCREATE macro includes all the functionality of DECLARE_DYNAMIC.

See the example for IMPLEMENT_DYNCREATE.

Community Additions

ADD
Show:
© 2014 Microsoft