D5 has a Supports() function:

function Supports(const Instance: IUnknown; const Intf: TGUID; out Inst):
Boolean;
function Supports(Instance: TObject; const Intf: TGUID; out Inst): Boolean;

HTH
Xander

----- Original Message -----
From: Neven MacEwan <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Friday, June 30, 2000 2:00 PM
Subject: [DUG]: Easier Way to use Interfaces on Components


> Hiya All
>
> Ive been using QueryInterface rather than is and as class operators but
> QueryInterface is protected so I keep on having to do the following
>
> TIC = class(TComponent)
> end;
>
> var
>   MyIF: IMyIF
>
> if TIC(MyComp).QueryInterface(IMyIF, MyIF) = S_OK then ...
>
> Am I missing something?
>
>
> Regards Neven
> N.K. MacEwan B.E. E&E
> [EMAIL PROTECTED]
>
> --------------------------------------------------------------------------
-
>     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