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

Marcos Douglas md at delfire.net
Fri Mar 13 14:24:39 CET 2015


On Fri, Mar 13, 2015 at 7:06 AM, Michael Van Canneyt
<michael at freepascal.org> 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.

+1

Marcos Douglas




More information about the Lazarus mailing list