09-21-2022, 04:34 PM
Hi,
I need to limit sessions for my IWApplication
I have two sessions A and B ... from session B I want to close session A
I found this procedure from a previous thread that seems to work correctly:
//**********************************************************************
procedure TFMain.TerminateSession(const AAppId: string);
var
lApp: TIWApplication;
lExpired, lLocked: Boolean;
begin
lApp := gSessions.LookupAndLock(AAppId, lExpired, lLocked);
if Assigned(lApp) and not lExpired then
begin
try
lApp.Terminate('Sessione Terminata !');
finally
lApp.Unlock;
end;
end;
end;
//*********************************************************************
I need to communicate a message to the user of session A
if they are in the main form the message included as a parameter seems to work
if the user is in a window inside my app I get an intraweb (404) error message (?)
how can i solve?
thanks
Alessandro Romano
I need to limit sessions for my IWApplication
I have two sessions A and B ... from session B I want to close session A
I found this procedure from a previous thread that seems to work correctly:
//**********************************************************************
procedure TFMain.TerminateSession(const AAppId: string);
var
lApp: TIWApplication;
lExpired, lLocked: Boolean;
begin
lApp := gSessions.LookupAndLock(AAppId, lExpired, lLocked);
if Assigned(lApp) and not lExpired then
begin
try
lApp.Terminate('Sessione Terminata !');
finally
lApp.Unlock;
end;
end;
end;
//*********************************************************************
I need to communicate a message to the user of session A
if they are in the main form the message included as a parameter seems to work
if the user is in a window inside my app I get an intraweb (404) error message (?)
how can i solve?
thanks
Alessandro Romano