PPropInfo ppi;
PTypeInfo pti;
TTypeKinds ttk;
TRttiContext context;
TRttiType *rttiType
TObject* objTemp; objTemp = GetObjectProperty(this, "Font"); if (objTemp) { PPropInfo ppi; ppi = GetPropInfo(objTemp->ClassType(), "Size"); if (ppi && (*ppi->PropType)->Kind == tkInteger) SetOrdProp(objTemp, ppi, 12); }
cb6要自己写函数GetObjectProperty,XE6里系统自带在Datasnap.Provider.hpp中定义了
TObject* GetObjectProperty(TObject *AObject, const String APropName) { PPropInfo ppi; PTypeInfo pti; ppi = GetPropInfo(AObject->ClassType(), APropName); if (ppi && (*ppi->PropType)->Kind == tkClass) return GetObjectProp(AObject, ppi); return NULL; }