B
Bryan
If I have this:
// .h
class Base : public CObject
{
public:
DECLARE_DYNAMIC(Base)
}
class Derived : public Base
{
public:
DECLARE_DYNAMIC(Derived)
}
If I try to do something like this in the .cpp file, Im not getting what
I expected:
// .cpp stuff
IMPLEMENT_DYNAMIC(Base, CObject)
IMPLEMENT_DYNAMIC(Derived, Base)
Derived derived_class;
BOOL b = derived_class.IsKindOf(RUNTIME_CLASS(Derived));
// This returns false!
BOOL b = derived_class.IsKindOf(RUNTIME_CLASS(Base));
// Returns true...
I thought from reading the docs that that BOTH of these would return
true. This is in fact the kind of behavior I am looking for, but so far
no luck.
What am I doing wrong, or how can I get this functionality?
Thanks,
B
// .h
class Base : public CObject
{
public:
DECLARE_DYNAMIC(Base)
}
class Derived : public Base
{
public:
DECLARE_DYNAMIC(Derived)
}
If I try to do something like this in the .cpp file, Im not getting what
I expected:
// .cpp stuff
IMPLEMENT_DYNAMIC(Base, CObject)
IMPLEMENT_DYNAMIC(Derived, Base)
Derived derived_class;
BOOL b = derived_class.IsKindOf(RUNTIME_CLASS(Derived));
// This returns false!
BOOL b = derived_class.IsKindOf(RUNTIME_CLASS(Base));
// Returns true...
I thought from reading the docs that that BOTH of these would return
true. This is in fact the kind of behavior I am looking for, but so far
no luck.
What am I doing wrong, or how can I get this functionality?
Thanks,
B