Have you tried

if Supports(aObject, IFirstInterface,oFirstInterface)

Interface inheritance is different from object inheritance, and can seem odd
until you get your head around it.  But the supports function always will
give you the answer you require providing you are using D6 or later.


Trevor
----- Original Message -----
From: "Todd Martin" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Friday, June 13, 2003 1:52 PM
Subject: [DUG]: Interface Inheritance


> Hi
>
> 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.
>
> Todd.
>
>
> --------------------------------------------------------------------------
-
>     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/
>
>


---------------------------------------------------------------------------
    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/

Reply via email to