Comparing pointers doesn't work because the two bases have different offset, and casting to
CClass
may not be what you mean (may be it is not the only class in your system actually having this "property").
The proper way is
dynamic_cast<void*>(pobj1) == dynamic_cast<void*>(pobj2)
that, by definition, will compare the addresses of the most external part of the objects whatever the runtime type is and whatever the compared bases are.