Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-07

Doubts about QueryInterface

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Agustin Barto

When I try to compile a unit in delphi mode with the following function

function Implements(out AReference; const AObject: TObject; const
AInterface: TGUID): Boolean;
begin
  Result := (AObject is TInterfacedObject) and
    ((AObject as TInterfacedObject).QueryInterface(AInterface, AReference) = 0);
end;

I get:

Utilities.pas(33,44) Error: identifier idents no member "QueryInterface"
Utilities.pas(33,58) Fatal: Syntax error, ")" expected but "(" found
Utilities.pas(33,58) Error: Compilation aborted

What am I doing wrong?