> 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