|
<< Click to Display Table of Contents >> Delphi Examples: DbiStartSession |
![]() ![]()
|
Example 1: Start a new session for the client application.
Delphi programs can use the TSession object in the component library.
procedure fDbiStartSession(pName: string; var hSes: hDBISes; pNetDir: string);
begin
Check(DbiStartSession(PChar(pName), hSes, PChar(pNetDir)));
end;
Example 2: Create a new session and return the session number.
Most Delphi users can use TSession.Open, TSessionList.OpenSession or the TSession component.
This example uses the following input:
SesNo := fDbiStartSession('NewSession', hSes, 'C:\Netdir');
The function is:
function fDbiStartSession(pName: string; var hSes: hDBISes; pNetDir: string): Word;
var
Ses: SESInfo;
begin
Check(DbiStartSession(PChar(pName), hSes, PChar(pNetDir)));
Check(DbiGetSesInfo(Ses));
Result := Ses.iSession;
end;