Am 06.09.2017 10:31 schrieb "Graeme Geldenhuys" <
mailingli...@geldenhuys.co.uk>:
> type
>   IHook = interface
>     ['{4BCAEDD8-92D8-11E7-88D3-C86000E37EB0}']
>     procedure DoIt;
>   end;
>
> type
>   THook = class(TInterfacedObject, IHook)
>   private
>     procedure DoIt;
>   end;
>
>   procedure THook.DoIt;
>   begin
>     writeln(ClassName + ' did it');
>   end;

I think THook needs to derive from TAggregatedObject, cause that couples
the reference counting to that of the controlling instance.
See here:
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Implementing_Interfaces

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to