forked from grijjy/GrijjyFoundation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Grijjy.System.pas
44 lines (35 loc) · 1003 Bytes
/
Grijjy.System.pas
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
unit Grijjy.System;
{$INCLUDE 'Grijjy.inc'}
interface
type
{ Abstract base class for classes that can implement interfaces, but are not
reference counted (unless on ARC systems of course). If you want your class
to be reference counted, derive from TInterfacedObject instead. }
TgoNonRefCountedObject = class abstract(TObject)
{$REGION 'Internal Declarations'}
protected
{ IInterface }
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
{$ENDREGION 'Internal Declarations'}
end;
implementation
{ TgoNonRefCountedObject }
function TgoNonRefCountedObject.QueryInterface(const IID: TGUID;
out Obj): HResult;
begin
if GetInterface(IID, Obj) then
Result := S_OK
else
Result := E_NOINTERFACE;
end;
function TgoNonRefCountedObject._AddRef: Integer;
begin
Result := -1;
end;
function TgoNonRefCountedObject._Release: Integer;
begin
Result := -1;
end;
end.