TinterfacedObject已经提供基本应用计数功能,不需要再复写function _AddRef: Integer; stdcall;和function _Release: Integer; stdcall;这两个方法,如果你的接口类是继承TComponent,那你就要复写那两个方法。
TInterfacedObject is a thread-safe base class for Delphi classes that support interfaces. TInterfacedObject provides basic reference-counting functionality that makes its descendant classes useful in both Delphi and C++ code.