[fpc-pascal] Implementing an interface force me to add _AddRef, _Release

Michael Van Canneyt michael at freepascal.org
Fri Apr 16 09:06:12 CEST 2010



On Fri, 16 Apr 2010, Graeme Geldenhuys wrote:

> Marc Weustink het geskryf:
>> You cannot use casts like
>> var
>>    a: IMyObject;
>>    b: IMyOtherObject;
>> begin
>>    b := a as IMyOtherObject;
>>
>> or functions like supports() (which uses queryinterface)
>
> I remember reading something about this a year or two ago in the mailing
> list. As far as I remember, there was an alternative to do the same thing
> with CORBA-style interfaces, but for the life of me I can't remember what
> it was. I'll keeps searching to see if I can find the answers I am
> referring to.
>
> While searching I did find one of my old message threads. And the answers
> to the questions I asked then, still elude me [4 years later]. :-(
>
>  http://lists.freepascal.org/lists/fpc-devel/2007-November/012060.html
>
>
> @Michael van Canneyt
> Maybe the Language Reference documentation could be extended to include
> such information? And maybe address the issues I mentioned the the message
> thread link I posted. Many developers seem to struggle with this, and the
> documentation seems the right place to address such info.

You are right. I will have a look at the docus.

Michael.



More information about the fpc-pascal mailing list