I probably should have been clearer in my reply. This is what I was getting at, thanks Neven. ;-)
You have to explicitly declare every interface that you want your class to implement directly, i.e. with your original declaration, you can be sure that the compiler will force you to implement all the methods defined in IFirstDescendant, since by inheriting ISecondDescendant from IFirst, you have to implement them. However, they become 'part' of ISecondDescendant, and although the methods will end up being implemented on your class, they're part of ISecondDescendant. If you explicitly declare both IFirst and ISecond on your TNewClass, then when you implement the methods on your TNewClass, you will correctly implement both interfaces, and the compiler will be happy. HTH, Conor -----Original Message----- From: Neven MacEwan [mailto:[EMAIL PROTECTED] What does 'Supports' return? also you could declare TNewClass = class(TInterfacedObject, IFirstDescendant, ISecondDescendant); Neven ----- Original Message ----- From: "Todd Martin" <[EMAIL PROTECTED]> > Does anyone know if there's a way to test for interface inheritance? > For example > > IFirstDescendant = interface(IInterface); > ISecondDescendant = interface(IFirstDescendant); > > TNewClass = class(TInterfacedObject,ISecondDescendant); > > NewObject = TNewClass.Create; > > is there a way to see whether NewObject supports the interface > "IFirstDescendant" > > NewObject.GetInterface(IFirstDescendant,Descendant) > returns a nil pointer for Descendant. > > I'm thinking the VTable entry for the ISecondDescendant interface, might > link back to IFirstDescendant somehow. --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/