Seria algo como esto
Código Delphi
[-]
try
case typinfo.PropType(c,pn) of
tkInteger : SetOrdProp(c,pn,strtoint(pv));
tkInt64 : SetInt64Prop(c,pn,strtoint64(pv));
tkFloat : SetFloatProp(c,pn,strtofloat(pv));
tkChar,
tkWChar,
tkString,
tkLString,
tkWString : SetStrProp(c,pn,GetString(pv));
tkVariant : SetVariantProp(c,pn,pv);
tkMethod : SetMethodProp(c,pn,m);
tkEnumeration : SetEnumProp(c,pn,Trim(pv));
tkSet : SetSetProp(c,pn,Trim(pv));
tkClass : if (GetObjectPropClass(c,pn).ClassName = 'TStrings') then
(GetObjectProp(c,pn) as TStrings).CommaText := pv
else
if (GetObjectPropClass(c,pn).ClassName = 'TParams') then
begin
params := StringToParams(pv);
(GetObjectProp(c,pn) as TParams).Assign(params);
params.Free;
end
else SetObjectProp(c,pn,GetObject(nil,tpv));
else
SetPropValue(c,pn,pv);
end;
except
end;
tambien puedes mirar antes si la propiedad existe en el objeto destino. Te recomiendo que mires los tips de la pagina de neftali, donde hay otra variante de esta funcion y tambien una explicacion de PPropInfo. Tambien que mires sobre la funcion GetPropList y la unidad Typinfo.
PD: en el codigo, getobject es:
Código Delphi
[-]
function GetObject(c : TObject; s : string) : TObject;
begin
s := trim(s);
if s = '' then result := c;
if c = nil then c := Application;
result := GetObject((c as TComponent).FindComponent(Copy(s,0,Pos('.',s)-1),Copy(s,Pos('.',s)+1));
end;
stringtoparams transforma una string a tipo TParams, GetStrings devuelve una string entre comillas y m es un TMethod. Saludos y a ver si te sirve.