When i learn MFC,, I want to imitate some mechanism, here, i just want to imitate MFC’s the Mechanism of dynamic to create object Simple..Can you point out where is the fault, and how to finish it . Thank you…
class Object;
struct classRuntime
{
Object* pBasedClass;
Object* pNextClass;
char* className;
Object* CreateClass();
};
class Object
{
public:
static struct classRuntime ObjectClassRuntime;
Object() {
cout<<"Object constructor"<<endl;
}
static Object* CreateObject() {
return new Object;
}
};
classRuntime Object::ObjectClassRuntime = {NULL, NULL, "Object",
Object::CreateObject};

1 Answer