Hi,
I've got a question on how does "Supports" function work. Here is the quote from the FPC docs:
Check whether a class or given interface supports an interface. Supports checks whether Instance supports the interface identified by IID. It returns True if it is supported, False. Optionally, a pointer to the interface is returned to Intf.
Suppose I have the code like this:
Show quoted text 17 lines
The following call returns True as expected:
Supports(MyClassInstance, IMyExtendedInterface);
But this one returns False, that seems strange for me:
Supports(MyClassInstance, IMyBasicInterface);
"Supports" does not seem to take into account interfaces inheritance, so to make the second call work as expected, I have to change TMyClass declaration to
TMyClass = class(IInterfacedObject, IMyBasicInterface, IMyExtendedInterface)
So the questions are:
1) Is this an expected behavior?
2) Are there any detailed documentation to read on this subject? I have not found anything, "Supports" is not very google-friendly name :(
Thanks in advance.
---
Vladimir.
