continue with my previous investigation regarding the use of Interface with VCL.
How to implement identical methods with 2 and more Classes?
How to use Interface with VCL Classes?
I would like to have a code example to demonstrate where and how the two work together.
Or what is the classic benefit/usage of the two:
ISomething = interface
['{EFE0308B-A85D-4DF3-889C-40FBC8FE84D0}']
...
end;
TSomeThing = class(TSomeVCLObject, ISomething)
...
end;
Imagine you have
TSomeThingandTSomeThingElseclasses, but they do not have a common ancestor class. As-is, you would not be able to pass them to the same function, or call a common method on them. By adding a shared interface to both classes, you can do both, eg: