在constructor Create;构造函数里面,对一个全局变量CreateCount: Integer加1
constructor TYourClass.Create(...);
begin
inherited;
...
Inc(CreateCount);
end;
再在Destroy里面减1
destructor TYourClass.Destroy;
begin
Dec(CreateCount);
...
Inherited;
end;
这样你访问CreateCount就知道有多少个对象创建了.