方法一:
// 读属性
procedure TForm1.btn1Click(Sender: TObject);
var
I, Count : Integer;
PropInfo : PPropInfo; // typinfo.pas
TempList : PPropList;
k : TTypeKind;
begin
Count := GetPropList(wwDBGrid1, TempList);
if Count > 0 then
try
for I := 0 to Count - 1 do
begin
PropInfo := TempList^;
if (PropInfo^.PropType^.Kind) in [tklstring] then
begin
lst1.Items.Add(propinfo^.Name);
end;
end;
finally
FreeMem(TempList);
end;
end;
// 读方法有点难度,让高手写吧:)
方法二:
1。将对象转为文本,再分解出属性和事件,只能得到一对象事件挂上的方法(过程),
自定义的看不到。
object Form2: TForm2
Left = 214
Top = 103
Width = 696
Height = 480
Caption = 'Form2'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate //
PixelsPerInch = 96
TextHeight = 13
object btn1: TButton
Left = 312
Top = 232
Width = 75
Height = 25
Caption = 'btn1'
TabOrder = 0
OnClick = btn1Click
end
end
方法三:
参考函数
MethodName();
MethodAddress()
方法四:生成一个MAP文件对应EXE
编译的时候增加“Linker------->Map file 选择Detailed”
Map files struct:
offset = AV - $401000
offset = 448994 - 401000 = 47994
===============================================
Start Length Name Class
0001:00000000 00048480H .text CODE
0002:00000000 00000C24H .data DATA
0002:00000C24 0000023DH .bss BSS