[fpc-devel] Interface delegation - workaround?

Michael Van Canneyt michael at freepascal.org
Tue May 19 16:55:59 CEST 2009



On Tue, 19 May 2009, Graeme Geldenhuys wrote:

> Hi
>
> Regarding bug #12778
>   http://bugs.freepascal.org/view.php?id=12778
>
>
> Like I said before, I am no expert in using Interfaces. But why can't
> I do the following (see code below), which works perfectly when I run
> the program. Using delegation define or usecorba define in any
> combination. It's the same code as in the bug report, but I modified
> the property Hook to be an interface type.
>
> What's the difference having
>
>  property Hook: ITestInterface ... implements...
> vs
>  property Hook: THook ... implements..."

The difference is that you have access to the THook methods/properties.
THook just 'happens' also to implement the interface you need.

Michael.



More information about the fpc-devel mailing list