Thanks Denis

The problem is not all interfaced objects descend from TInterfacedObject (in
fact most dont)

So I might have to go back to RTTI

Rgards
Neven



----- Original Message -----
From: Dennis Chuah <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Wednesday, 24 November 1999 10:33
Subject: RE: [DUG]: Determining if Object Implements an interface


>
> 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
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to