Thanks Aaron
You've obvoiusly looked at this before
They sort of have a foot in the camp (TComponent declares _AddRef etc
virtually)
But then don't follow thru which makes interfaces of limited use
Another Why question looms..
.
Why doesn't TComponent Implement IUnknown?
Regards
Neven
----- Original Message -----
From: Aaron Scott-Boddendijk <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Wednesday, 24 November 1999 10:49
Subject: Re: [DUG]: Determining if Object Implements an interface
> > I've just started 'playing' with interfaces and I want a proc to
> > interate over a list on objects and if they implement and interface call
it
>
> > But I've run into a brick wall using "with combo as IanInterface do"
> > all I get is 'Operator not applicable to this operand type'
> > ie. What it the equivalent of 'is' for an interface
>
> 'as' is correct... However the Combo probably doesn't have any interfaces.
>
> when 'as' is used with an Interface identifier as the RHS the LHS must
> implement QueryInterface which comes from IUnknown.
>
> ISpam = interface
> procedure yadayadayada;
> end;
>
> var
> A :TObject;
> B :TInterfacedObject;
> begin
> with A as ISpam do ...
> // not applicable
> with B as ISpam do ...
> // ISpam not supported by B...
>
>
> Interfaces raise all sorts of issues when trying to interact with the non
interface
> paradigm of the vcl... Reserve your interface use for internal data
management
> and don't bother looking too hard for interface implementation through out
the VCL...
>
> --
> Aaron Scott-Boddendijk
> Jump Productions
> (07) 838-3371 Voice
> (07) 838-3372 Fax
>
>
> --------------------------------------------------------------------------
-
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz