[fpc-devel] Unicode resource strings
pascaldragon at googlemail.com
Thu Aug 23 09:52:07 CEST 2012
Am 22.08.2012 21:45, schrieb Graeme Geldenhuys:
> On 22 August 2012 10:19, Sven Barth <pascaldragon at googlemail.com> wrote:
>> Depending on how they implement it this might indeed be an interesting
>> feature that we could implement (cherry picking Delphi features ^^).
> It's already possible, just use IInterface (and TInterfacedObject)
> everywhere. :)
You need to work with variables of type IInterface then so that the
reference counting mechanism works correctly. The compiler does not
generate reference managament code if you work with a variable of type
TInterfacedObject or decendant. E.g.:
i := TSomeInterfacedObjectDescendant.Create;
(i as TSomeInterfacedObjectDescendant).SomeMethodOfThatClass;
This just looks ugly...
The other possibility is to define an interface for the class you want
to use, but that's duplication I'd like to avoid...
More information about the fpc-devel