Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Wolfgang Riedmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Terminating an application which runs in the background Date: Fri, 24 Mar 2017 09:24:09 +0100 Lines: 58 Message-ID: References: <0c459c45-4199-4fd7-acac-e6c5f2e66b58@googlegroups.com> <5a9a7f2c-3cf1-460a-aa98-7d1715b056bd@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: individual.net u9D0Sv3MH2lb9yB/1liueA/AXY9PRU+iEfveAvr2yxLxdnfv0= Cancel-Lock: sha1:yv82f3ds831lMp71fsroqr/MpQw= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:10341 Hi Karl, > > P.S. unfortunately such a powerful feature is missing in the .NET > > framework > > I'm just taking my first steps in .NET. Somewhere I found somemthing > similar to VO-Error-handling. Used this in my first app and it works > pretty well. But please don't ask for explanations... maybe I have to add that I use WPF, and sometimes also GUI agnostic DLLs. Therefore I cannot simply popup an error box. This is one of the things I use everywhere: static method LogException( oEx as Exception ) as void local oData as IDictionary local cLogFile as string local oLines as List oLines := List{} oLines:Add( "" ) oLines:Add( "class name:" + oEx:GetType():Name ) oLines:Add( "Message:" + oEx:Message ) oLines:Add( "Source:" + oEx:Source ) oLines:Add( "StackTrace:" + oEx:StackTrace ) oData := oEx:Data if oData != null_object oLines:Add( "Data:" ) if oData:Count > 0 foreach oEntry as DictionaryEntry in oData oLines:Add( oEntry:Key:ToString() + ":" + oEntry:Value ) next endif endif cLogFile := Path.Combine( Utility.ProgramPath(), "XSError.log" ) File.AppendAllLines( cLogFile, oLines ) if oEx:InnerException != null_object oLines:Clear() oLines:Add( "" ) oLines:Add( "InnerException:" ) File.AppendAllLines( cLogFile, oLines ) Utility.LogException( oEx:InnerException ) end return Wolfgang --