is not derived from
so you cannot cast its pointer to
CString* p_str = new CString(L"Hello");
CObject* p_obj = p_str;
I got this error from VC++ 2019:
error C2440: 'initializing': cannot convert from 'CString *' to 'CObject *'
used to inherit from
in older VC++ but not now.