type
ISomeInterface = interface
// Needs GUID
['{075F36D1-A1ED-11d3-8924-0080AD91AE51}']
end;
TSomeClass = class (IInterface, TInterfacedObject)
end;
var
SomeInterface: ISomeInterface;
SomeClass: TSomeClass;
Unk: IUnknown;
begin
SomeClass := TSomeClass.Create;
Unk := SomeClass;
if Unk.QueryInterface (ISomeInterface, SomeInterface) = S_OK then
// Interface exists
Hope this helps.
Dennis.
> -----Original Message-----
> Hiya All
>
> 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
>
> Regards
> Neven
>
>
>
>
>
> --------------------------------------------------------------
> -------------
> 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