首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > Delphi7 向XML中添加RTTI信息

Delphi7 向XML中添加RTTI信息

  • 资源大小:7.60 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: Delphi源码

资 源 简 介

Delphi7.0 向XML中添加RTTI信息,这个例子挺简单,希望大家喜欢,面向Delphi新手的,高手请绕道哦,下面是本例Delphi向XML中添加RTTI信息的关键性代码:   procedure TForm1.ComponentToDOM(iNode: IXmlNode; Comp: TPersistent);   var    nProps, i: Integer;    PropList: PPropList;    Value: Variant;    newNode: IXmlNode;   begin    nProps := GetTypeData (Comp.ClassInfo)^.PropCount;    GetMem (PropList, nProps * SizeOf(Pointer));    try    GetPropInfos (Comp.ClassInfo, PropList);    for i := 0 to nProps - 1 do    begin    Value := GetPropValue (Comp, PropList [i].Name);    NewNode := iNode.AddChild(PropList [i].Name);    NewNode.Text := Value;    if (PropList [i].PropType^.Kind = tkClass) and (Value <> 0) then    if TObject (Integer(Value)) is TComponent then    NewNode.Text := TComponent (Integer(Value)).Name    else    ComponentToDOM (newNode, TObject (Integer(Value)) as TPersistent);    end;    finally    FreeMem (PropList);    end;   end;

文 件 列 表

srcfans.com
向XML中添加RTTI
Project1.dof
向XML中添加RTTI
向XML中添加RTTI
Project1.cfg
srcfans.com
VIP VIP
0.189332s