#include "stdafx.h"
#include <stdio.h>
class CAge
{
DECLARE_DYNAMIC(CAge)
;
};
int main(int argc, char* argv[])
{
CAge *pAge = new CAge;;
if(pAge->IsKindOf(RUNTIME_CLASS(CAge)))
{
printf("hello runtime class1");
}
delete pAge;
return 0;
}
我是在控制台应用程序中的
当我运行时,提示
--------------------Configuration: CCCC - Win32 Debug--------------------
Compiling...
CCCC.cpp
D:\CCCC\CCCC.cpp(19) : error C2039: 'IsKindOf' : is not a member of 'CAge'
D:\CCCC\CCCC.cpp(10) : see declaration of 'CAge'
D:\CCCC\CCCC.cpp(19) : error C2065: 'RUNTIME_CLASS' : undeclared identifier
D:\CCCC\CCCC.cpp(19) : error C2275: 'CAge' : illegal use of this type as an expression
D:\CCCC\CCCC.cpp(10) : see declaration of 'CAge'
Error executing cl.exe.
CCCC.obj - 3 error(s), 0 warning(s)