Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Access violation in SA running as a service
#4
Hi,
Finally I found the solution. Root cause was the Application Working directory: when running in mode Service, must be changed using this code:

procedure TIWServerController.IWServerControllerBaseCreate(Sender: TObject);
var
Path: array[0..MAX_PATH] of Char;
ExtractedPath: string;
I: Integer;
begin
GetModuleFileName(HInstance, Path, SizeOf(Path));
ExtractedPath := string(Path);
I := LastDelimiter('\', ExtractedPath);
if I > 0 then
ExtractedPath := Copy(ExtractedPath, 1, I - 1);

SetCurrentDir(ExtractedPath);

Pool.Active := True;

end;

With this change, everything works as expected.

KR,
Venancio Lasquibar
Reply


Messages In This Thread
RE: Access violation in SA running as a service - by v.lasquibar@telefonica.net - 06-25-2025, 05:41 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)