Quote Originally Posted by savage
You don't have to derive your class from IUnknown in Delphi or Kylix either, and just to clarify, as far as I am aware, they are not known as CORBA interfaces, they are just known as interfaces, while the Win32 variety are known as COM interfaces.
Unluckly as it turn out this is not true.. In delphi if you declare just "interface" you are really declaring "interface(IUnknown)". You cannot avoid that and COM is the only type of interface supported.

I call them CORBA interfaces becouse you can use them in FPC with the {$INTERFACES CORBA} directive, as opposed with {$INTERFACES COM} that is the default.

As Clootie says i've to choose among using corba interfaces and loosing delphi compatibility or review my design..
I think i'll avoid to drop delphi and kylix (even if i'm doing everithing in FPC now)..

I've noticed anyway that you can declare a "procedure free" on an interface and use that to free the underlying object. I've tested it and it effectively works (Destroy gets called).
So i've created this:

[pascal]
type IFreeable = interface
procedure free;
end;
[/pascal]

So one can derive from it and free objects.
That seems to have been a waste of effort anyway