[fpc-pascal] Inherit interface from 2 interfaces

Flávio Etrusco flavio.etrusco at gmail.com
Fri Apr 8 22:12:50 CEST 2011


On Fri, Apr 8, 2011 at 6:16 AM,  <michael.vancanneyt at wisa.be> wrote:
>
>
> On Fri, 8 Apr 2011, Zaher Dirkey wrote:
>
>> 2011/4/7 Flávio Etrusco <flavio.etrusco at gmail.com>
>>
>>> On Wed, Apr 6, 2011 at 1:37 PM, Zaher Dirkey <parmaja at gmail.com> wrote:
>>>>
>>>> Can i do that?
>>>> type
>>>>  IIntf3 = interface(IIntf11, IIntf2)
>>>> ....
>>>>  end;
>>>>
>>>> Thanks in advance.
>>>> --
>>>> Zaher Dirkey
>>>>
>>>
>>> For Corba interfaces, yes. Not for COM interfaces.
>>> http://www.freepascal.org/docs-html/ref/refse39.html
>>>
>>>
>> I added {$INTERFACES CORBA} but same error ~Fatal: Syntax error, ")"
>> expected but "," found~ in the line ~IIntf3 = interface(IIntf11, IIntf2)~
>
> The whole idea of interfaces is to avoid multiple inheritance.
>
> So you can never inherit from more than one interface.
>
> Also not in CORBA interfaces. The mentioned page of the manual nowhere
> states that this is possible. It just says that for CORBA interfaces,
> the interface does not descend from IUnknown.
>
> Michael.

My bad, I just answered based on the Delphi implementation.
I sent the link just for the sake of "reference".

Best regards,
Flávio



More information about the fpc-pascal mailing list