blob: 34621e29fc6b62077201046c13b2d335ca8b8351 (
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
program corbainterface;
{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
{$ifdef mswindows}{$apptype console}{$endif}
uses
sysutils;
type
{$interfaces corba}
icorbainterface1 = interface ['{9E8B9751-7779-4484-B6B7-960D18ACE7AB}']
procedure iproc1;
end;
icorbainterface2 = interface ['MSE1']
procedure iproc2;
end;
{$interfaces com}
icominterface = interface ['{BC9EF8D0-2B67-4E5C-9952-05DF15A71567}']
procedure iproc3;
end;
ttestclasscorba = class(tobject,icorbainterface1,icorbainterface2)
public
procedure iproc1;
procedure iproc2;
end;
ttestclasscom = class(tinterfacedobject,icominterface)
public
procedure iproc3;
end;
{ ttestclass }
procedure ttestclasscorba.iproc1;
begin
end;
procedure ttestclasscorba.iproc2;
begin
end;
{ ttestclasscom }
procedure ttestclasscom.iproc3;
begin
end;
var
testclass1: ttestclasscorba;
testclass2: ttestclasscom;
po1: pointer;
begin
testclass1:= ttestclasscorba.create;
testclass2:= ttestclasscom.create;
if testclass1.getinterface(icorbainterface1,po1) then begin
writeln('getinterface icorbainterface1 found');
end
else begin
writeln('getinterface icorbainterface1 not found');
end;
if testclass1.getinterface(icorbainterface2,po1) then begin
writeln('getinterface icorbainterface2 found');
end
else begin
writeln('getinterface icorbainterface2 not found');
end;
if testclass2.getinterface(icominterface,po1) then begin
writeln('getinterface icominterface found');
end
else begin
writeln('getinterface icominterface not found');
end;
if testclass1.getinterfacebystr('MSE1',po1) then begin
writeln('getinterfacebystr MSE1 found');
end
else begin
writeln('getinterfacebystr MSE1 not found');
end;
testclass1.free;
testclass2._Release;
end.
|