首页 > 代码库 > XE6 c++builder 设置 font size GetPropInfo SetOrdProp

XE6 c++builder 设置 font size GetPropInfo SetOrdProp

    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;}