Todd Martin asks:

> I'm thinking the VTable entry for the ISecondDescendant interface, might
> link back to IFirstDescendant somehow.

No, The VTable specification for interfaces is basically a chunk of of
vitutal method table that implements the methods defined by an interface.
Interface "inheritance" is more of a shorthand for defining the interfaces
in the first place. The "inheritance" is only a compile time, and perhaps
TypeLib, time thing.

But because you are implementing all methods of IFirstDescendant in
ISecondDescendant you can very easily declare your example as follows:

> IFirstDescendant = interface(IInterface);
> ISecondDescendant = interface(IFirstDescendant);
>
> TNewClass = class(TInterfacedObject, IFirstDescendant, ISecondDescendant);

Then your test will work as the VTable information will be all available.
This of cource assumes that you actually want TNewClass to provide an
IFirstDescendant at all.

In certian situation you may not want IFirstDescendant to be available if
ISecondDescendant is available, and so Delphi's behaviour is actually to
your benefit as it allow comlpete control over exactly what interfaces an
object makes available to QueryInterface. It is always better to have this
sort of thing declarative tather then implicit.

Cheers, Max.

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