-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUnit2.~pas
More file actions
56 lines (44 loc) · 981 Bytes
/
Unit2.~pas
File metadata and controls
56 lines (44 loc) · 981 Bytes
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
49
50
51
52
53
54
55
56
unit Unit2;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
ComObj, ActiveX,StdVcl, Dialogs,unit3,Project1_TLB;
type
TMyObject = class(TAutoObject, IMyObject)
protected
FCount: Integer;
function ShowMsg(const s: WideString): Integer; safecall;
function Get_Count: Integer; safecall;
procedure AddCount; safecall;
procedure Set_Count(Value: Integer); safecall;
public
procedure Initialize; override;
end;
implementation
uses ComServ;
function TMyObject.ShowMsg(const s: WideString): Integer;
begin
ShowMessage(S);
Result:= 1;
end;
function TMyObject.Get_Count: Integer;
begin
Result:= FCount;
end;
procedure TMyObject.AddCount;
begin
Inc(FCount);
end;
procedure TMyObject.Set_Count(Value: Integer);
begin
FCount:= Value;
end;
procedure TMyObject.Initialize;
begin
FCount:= 0;
inherited;
end;
initialization
TAutoObjectFactory.Create(ComServer, TMyObject, Class_MyObject,
ciMultiInstance, tmApartment);
end.