Declare

xiaoxiao2021-03-06  46

MFC Library Reference

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)

Parameter

Class_name

The Actual Name of the Class.

Remarks

Add the declare_dynamic macro to the header (.h) Module for the class, the include That module in all .cpp modules.....

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 INCLUDEDIN The Class Implementation.

转载请注明原文地址:https://www.9cbs.com/read-112491.html

New Post(0)