小编Use*_*007的帖子

有没有办法在Delphi 7中获取旧样式(Borland Pascal)对象实例的类名?

我班上有很多后代:

PMyAncestor =^TMyAncestor;
TMyAncestor = object
  public
    constructor init;
    destructor done; virtual;
    // There are virtual methods as well
end;

PMyDescendant1 =^TMyDescendant1;
TMyDescendant1 = object ( TMyAncestor )
end;

PMyDescendant2 =^TMyDescendant2;
TMyDescendant2 = object ( TMyAncestor )
end;

PMyDescendant3 =^TMyDescendant3;
TMyDescendant3 = object ( TMyDescendant2 )
end;

procedure foo;
var
  pMA1, pMA2, pMA3, pMA4 : PMyAncestor;
  s : string;
begin
  pMA1 := new( PMyAncestor, init );
  pMA2 := new( PMyDescendant1, init );
  pMA3 := new( PMyDescendant2, init );
  pMA4 := …
Run Code Online (Sandbox Code Playgroud)

delphi rtti

5
推荐指数
1
解决办法
161
查看次数

标签 统计

delphi ×1

rtti ×1