diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-03-21 14:47:12 +0000 |
---|---|---|
committer | David Laurence Emerson <dle3ab@angelbase.com> | 2013-05-28 00:42:49 -0700 |
commit | e7da16a116d93ecc730e92d542e8a7398bea4672 (patch) | |
tree | 2382865a556431579e380d3fb240969abc52bee6 /examples/gui | |
parent | ddd405fceb17209474b7569f49894ed3155ba3f4 (diff) | |
download | fpGUI-e7da16a116d93ecc730e92d542e8a7398bea4672.tar.xz |
demo: updated TNullInterfacedObject implementation.
- It was missing the IUnknown declaration in the class
- The IUnknown signature has changed in recent FPC versions.
Diffstat (limited to 'examples/gui')
-rw-r--r-- | examples/gui/command_interface/commands.pas | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/gui/command_interface/commands.pas b/examples/gui/command_interface/commands.pas index c487b0b1..d4a30858 100644 --- a/examples/gui/command_interface/commands.pas +++ b/examples/gui/command_interface/commands.pas @@ -14,11 +14,11 @@ uses type // non reference counted interface - TNullInterfacedObject = class(TObject) + TNullInterfacedObject = class(TObject, IUnknown) protected - function QueryInterface(const IID: TGUID; out Obj): longint; stdcall; - function _AddRef: longint; stdcall; - function _Release: longint; stdcall; + function QueryInterface(constref iid : tguid;out obj) : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF}; + function _AddRef : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF}; + function _Release : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF}; end; @@ -44,7 +44,7 @@ uses { TNullInterfacedObject } -function TNullInterfacedObject.QueryInterface(const IID: TGUID; out Obj): longint; stdcall; +function TNullInterfacedObject.QueryInterface(constref IID: TGUID; out Obj): longint; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF}; begin if GetInterface(IID, Obj) then Result := 0 @@ -52,12 +52,12 @@ begin result := integer(e_nointerface); end; -function TNullInterfacedObject._AddRef: longint; stdcall; +function TNullInterfacedObject._AddRef: longint; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF}; begin Result := -1; end; -function TNullInterfacedObject._Release: longint; stdcall; +function TNullInterfacedObject._Release: longint; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF}; begin Result := -1; end; @@ -72,7 +72,7 @@ end; procedure TAddCommand.Execute; begin - Writeln('>> TAddComand.Execute'); + DebugLn('>> TAddComand.Execute'); FMemo.Lines.Add('Hello ' + IntToStr(Random(500))); FMemo.Invalidate; end; @@ -81,7 +81,7 @@ end; procedure TExitCommand.Execute; begin - Writeln('>> TExitComand.Execute'); + DebugLn('>> TExitComand.Execute'); fpgApplication.Terminated := True; end; |