summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw10684.pp
blob: 52dcac4f7adb5edce2bb56b6c307bc3871299cee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
program test_intf_query;

{$IFDEF FPC}
  {$MODE OBJFPC}{$H+}
{$ENDIF}

uses
  Classes;

type
  ISimple = interface
  ['{24811FF3-4F01-4601-AC5C-22A5B5D46928}']
    function ShowSomething: Integer; cdecl;
    function GetIsBlob: Boolean; cdecl;
  end;

  TSimple = class(TInterfacedObject, ISimple)
  protected
    { ISimple implementation }
    function ShowSomething: Integer; cdecl;
    function GetIsBlob: Boolean; cdecl;
  end;

function QuerySimple(const OnChange: TNotifyEvent = nil): ISimple; cdecl;
begin
  Result := TSimple.Create;
end;

function TSimple.ShowSomething: Integer; cdecl;
begin
  Writeln('Message from ISimple');
  Result := 0;
end;

function TSimple.GetIsBlob: Boolean; cdecl;
begin
  Result := true;
end;

{*** main program ***}

var
  FSimple: ISimple;

begin
  FSimple := QuerySimple;
  FSimple.ShowSomething;
end.