[Lazarus] How to cast a Interface to a Object in Lazaeus

Martin Schreiber mse00000 at gmail.com
Fri Mar 13 11:22:04 CET 2015


On Friday 13 March 2015 11:06:19 Michael Van Canneyt wrote:
> On Fri, 13 Mar 2015, Martin Schreiber wrote:
> > On Friday 13 March 2015 10:49:43 aradeonas wrote:
> >> OK,So in the end how can I cast a Interface to a Object in Lazarus?
> >
> > I usually add a "function getinstance(): <theBaseImplemetationClass>" to
> > the interface definition.
>
> Which goes completely against the very purpose of interfaces.
>
> If you need this, you should not be using interfaces to begin with.
>
> The only possible excuse is an external requirement to use interfaces.
>
I do not agree.

Martin




More information about the Lazarus mailing list