![]() |
AW: Stringlist bringt Service zum Absturz
Stimmt, SvcMgr.Application (TServiceApplication) hat kein OnException,
aber SvcMgr läßt die unit Forms. Forms.Application hat ein OnException. Aber jetzt fällt mir da wieder was ein. Leider ist TServiceApplication so schrottig programmiert, daß man da nicht mehr an die Exceptionbehandlung rankommt, ohne die von TServiceApplication zu schrotten. (es sei denn man möchte das Logging in den Windows-Event-Logs ( ![]() Wenn du TService (SvcMgr) verwendest, dann füge mal Folgendes in deine Service-Anwendung (DPR) ein.
Delphi-Quellcode:
Und ja, Application wird am ende nicht wieder freigegeben ... das macht die Unit SvcMgr für uns.
uses SysUtils, Classes, SvcMgr, ...;
{$R *.RES} type TServiceApplicationHack = class(TServiceApplication) protected procedure DoHandleException(E: Exception); override; end; procedure TServiceApplicationHack.DoHandleException(E: Exception); begin // hier kannst du E.Message irgendwo hin loggen inherited; end; begin Application.Free; Application := TServiceApplicationHack.Create(nil); ... |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:16 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz