On Fri, Sep 16, 2011 at 4:46 AM, Graeme Geldenhuys <graemeg.li...@gmail.com> wrote: > You're original problem is exactly why I said mixing class instances and > interface instance is looking for trouble. You better know what you are > doing. > > Attached are two examples of your program. One using CORBA interfaces, > the other using non-reference counting COM style interface. Both work > under 64-bit FPC 2.4.5 under Linux.
Thanks, but... The testme.pas has the TNonRefCountedObject class, but it isn't used. Both has the {$interfaces corba} directive. Anyway, corba interfaces looks like solve my "problem" but I did more tests, using corba: 1- If I change the Run procedure (see comments), how I release [f] variable? procedure Run; var f: IFoo; // <<< now is an interface o: TObj; begin f := TFoo.Create; //f.SetInfo('foo'); // do not exists in IFoo, but OK o := TObj.Create; o.Foo := f; writeln(o.Foo.GetInfo); o.Free; //f.Free // <<< how I release this? end; I.e. this is the inverse of COM interfaces -- inverse of my problem too -- because I just could instantiate variables of concrete classes and not variables of type interface. Maybe the union of both... or Am I saying a nonsense? Marcos Douglas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal