[fpc-pascal] Interface, _AddRef, _Release, etc.

Marcos Douglas md at delfire.net
Thu Sep 15 16:54:36 CEST 2011

On Thu, Sep 15, 2011 at 6:27 AM, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:
> On 14/09/2011 23:17, Marcos Douglas wrote:
>> procedure Run;
>> var
>>   f: TFoo;  // << type is class, not interface
>>   o: TObj;
>> begin
>>   f := TFoo.Create;
> This is just wrong.

Well, wrong just because the language is so but not because is ilogical, right?

> On a side note:
> ---------------
> Why not simply use CORBA interfaces, then you don't need to add the
> IUnknown or IInterface interface method noise to your class declaration.
> CORBA interfaces are not reference counted.
> eg:
> unit myunit;
> {$mode objfpc}{$H+}
> {$interfaces corba}

Hm... interesting but what are the advantages?
I want my code compiling in Delphi 7 too, so I can have problems with this?

The TInterfacedObject class is the most used in many codes (like Zeos
for example) and it works. I do not want problems, incompatibilities,
confusion, etc

Marcos Douglas

More information about the fpc-pascal mailing list