[fpc-pascal] inherited interfaces not seen by queryinterface / supports

David Emerson dle3ab at angelbase.com
Thu Oct 27 21:31:41 CEST 2016


On 10/27/2016 06:01 AM, Tony Whyman wrote:

> That is you can build an object hierarchy to parallel an interface
> hierarchy.
>
> I don't use the "Supports" primitive. - so maybe there is a bug in this
> feature but otherwise, what is the problem with interface inheritance?

Yes, the problem is with "Supports" and "QueryInterface".
All of the examples you gave work fine (I didn't test them but they look 
like tests I've done)

The situation where "Supports" is needed looks more like this:

function do_something (t : tobject);
begin
   if supports (t, i_my_interface) then ....


So the situation is that we were passed an object, and we don't know 
what it is; but if we learn that it supports a particular interface, 
then we want to do something with that interface.

~David.






More information about the fpc-pascal mailing list