Specifications

COM+ reference
Gallagher & Robertson Glink: API reference manual 19
procedure TForm1.SetupSession(sesstype: integer);
var
V : Variant;
I, N : Integer;
Conf : IGlinkConfiguration;
begin
case sesstype of
(* We select a predefined Glink config file 'my
config.glinkconfig' *)
1 : GlinkApi1.SessionName ('my config');
(* We select the first in the available list *)
2 :
begin
V := GlinkApi1.getAvailableSessions;
if not VarIsNull(V) and not VarIsEmpty(V) then
begin
N := VarArrayHighBound(V, 1);
(* just list all we get *)
for I := 0 to N do
Listbox1.Items.Add('Session: ' + V[I]);
GlinkApi1.SessionName (V[0]);
end;
end;
(* we create our own from scratch *)
3:
begin
Conf := GlinkApi1.GlinkConfiguration
('My very own host config',
GlinkConfiguration_EMULATION_VIP7804,
GlinkConfiguration_PROTOCOL_TNVIP,
'localhost');
if Conf = nil then
Listbox1.Items.Add
('Unable to create a new configuration object')
else
begin
GlinkApi1.addConfiguration (Conf);
GlinkApi1.sessionName (Conf.getName);
end;
end;
else (* Glink displays open config dialogbox *)
GlinkApi1.SessionName ('');
end;
end;
Add a Glink.GlinkApi event handler by double clicking the OnGlinkEvent in the
Events form of the Object inspector.