DECLARE_DYNAMIC

Adds the ability to access run-time information about an object's class when deriving a class from CObject.

DECLARE_DYNAMIC(class_name )

매개 변수

  • class_name
    The actual name of the class.

설명

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

If you use the DECLARE_DYNAMIC and IMPLEMENT_DYNAMIC macros as described, you can then use the RUNTIME_CLASS macro and the CObject::IsKindOf function to determine the class of your objects at run time.

If DECLARE_DYNAMIC is included in the class declaration, then IMPLEMENT_DYNAMIC must be included in the class implementation.

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

예제

See the example for IMPLEMENT_DYNAMIC.

요구 사항

Header: afx.h

참고 항목

참조

IMPLEMENT_DYNAMIC

DECLARE_DYNCREATE

DECLARE_SERIAL

RUNTIME_CLASS

CObject::IsKindOf

개념

MFC 매크로 및 전역