Is there a way to define an interface who inherits from two or more interfaces?
I tried the following code on Delphi2007:
  IInterfaceA = interface
     procedure A;
  end;
  IInterfaceB = interface
    procedure B;
  end;
  IInterfaceAB = interface(IInterfaceA, IInterfaceB);
.. and it raised an E2029 error:
E2029 ')' expected but ',' found
at line:
IInterfaceAB = interface(IInterfaceA, IInterfaceB).
There is no multiple interface inheritance in Delphi as there is no multiple inheritance in Delphi at all. All you can do is make a class implement more than one interface at once.
TMyClass = class(TInterfacedObject, IInterfaceA, IInterfaceB)
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With