Thread View: borland.public.delphi.nativeapi.win32
4 messages
4 total messages
Started by Marcia
Mon, 07 Jul 2008 16:39
Windows Error Reporting
Author: Marcia
Date: Mon, 07 Jul 2008 16:39
Date: Mon, 07 Jul 2008 16:39
24 lines
1602 bytes
1602 bytes
Hello ! My application need to show WER (Windows Error Reporting) when an access violation occurs in Vista. A developer said to me that is not necessary to write code to receive this behavior from my application. But, I made a kind of "Hello World" application in both environments: -using .net it works perfectly. The screen was show and I saw a Windows Error Report message in Event Viewer. -using Delphi 6 I received a Access Violation message but not a Windows Error Reporting message e nothing occurs in Event Viewer. I saw a code sample in C++ where the guy was accessing the WERAPI.h at the header. Is there someone can help me? Thanks in Advance
Re: Windows Error Reporting
Author: Peter Below (TeamB)
Date: Mon, 07 Jul 2008 17:19
Date: Mon, 07 Jul 2008 17:19
47 lines
2792 bytes
2792 bytes
Marcia wrote: > Hello ! > > My application need to show WER (Windows Error Reporting) when an > access violation occurs in Vista. > > A developer said to me that is not necessary to write code to receive > this behavior from my application. But, I made a kind of "Hello > World" application in both environments: > > -using .net it works perfectly. The screen was show and I saw a > Windows Error Report message in Event Viewer. > > -using Delphi 6 I received a Access Violation message but not a > Windows Error Reporting message e nothing occurs in Event Viewer. > > I saw a code sample in C++ where the guy was accessing the WERAPI.h > at the header. > > > Is there someone can help me? The standard Delphi VCL application traps all exceptions internally and passes them (if they are not handled by a try..except handler closer to its standard trap) to Application.HandleException. That fires the Application.OnException event, if there is a handler for it, or shows the exception dialog. As I understand it the Vista WER report (one of the most useless features ever invented IMO <g>) only handles exceptions that propagate into Windows API code. The VCL is explicitely designed to prevent that from ever happening, since it tends to kill the application stone dead, with no chance of recovery. If you find a way to call the appropriate API the Application.OnException event would be the one to call it from. But you have a problem if the API then terminates the process forcefully, since no cleanup would get done in this case. It is *much* preferrable to just show or log the error and then exit the application in a controlled manner, e.g. by calling Application.Terminate or by closing the main form. -- Peter Below (TeamB) Don't be a vampire (http://slash7.com/pages/vampires), use the newsgroup archives : http://www.tamaracka.com/search.htm http://groups.google.com
Re: Windows Error Reporting
Author: Marcia
Date: Tue, 08 Jul 2008 17:48
Date: Tue, 08 Jul 2008 17:48
58 lines
3221 bytes
3221 bytes
Thank you Peter ! I still have difficulty to write this code. Anyone has some sample code? Thanks in Advance. "Peter Below (TeamB)" <none@nomail.please> escreveu na mensagem news:xn0fsel5k215j6003@newsgroups.borland.com... > Marcia wrote: > >> Hello ! >> >> My application need to show WER (Windows Error Reporting) when an >> access violation occurs in Vista. >> >> A developer said to me that is not necessary to write code to receive >> this behavior from my application. But, I made a kind of "Hello >> World" application in both environments: >> >> -using .net it works perfectly. The screen was show and I saw a >> Windows Error Report message in Event Viewer. >> >> -using Delphi 6 I received a Access Violation message but not a >> Windows Error Reporting message e nothing occurs in Event Viewer. >> >> I saw a code sample in C++ where the guy was accessing the WERAPI.h >> at the header. >> >> >> Is there someone can help me? > > The standard Delphi VCL application traps all exceptions internally and > passes them (if they are not handled by a try..except handler closer to > its standard trap) to Application.HandleException. That fires the > Application.OnException event, if there is a handler for it, or shows > the exception dialog. As I understand it the Vista WER report (one of > the most useless features ever invented IMO <g>) only handles > exceptions that propagate into Windows API code. The VCL is explicitely > designed to prevent that from ever happening, since it tends to kill > the application stone dead, with no chance of recovery. > > If you find a way to call the appropriate API the > Application.OnException event would be the one to call it from. But you > have a problem if the API then terminates the process forcefully, since > no cleanup would get done in this case. It is *much* preferrable to > just show or log the error and then exit the application in a > controlled manner, e.g. by calling Application.Terminate or by closing > the main form. > > -- > Peter Below (TeamB) > Don't be a vampire (http://slash7.com/pages/vampires), > use the newsgroup archives : > http://www.tamaracka.com/search.htm > http://groups.google.com
Re: Windows Error Reporting
Author: Raul
Date: Wed, 09 Jul 2008 19:05
Date: Wed, 09 Jul 2008 19:05
70 lines
3688 bytes
3688 bytes
You re-posted this to delphi.win32. Here's a possible answer (with sample code): http://www.davinciunltd.com/2007/11/crashing-like-vb/ Raul "Marcia" <marcia.macena@ppi-multitask.com.br> wrote in message news:4873a8b3@newsgroups.borland.com... > Thank you Peter ! > > I still have difficulty to write this code. > > Anyone has some sample code? > > Thanks in Advance. > > > "Peter Below (TeamB)" <none@nomail.please> escreveu na mensagem > news:xn0fsel5k215j6003@newsgroups.borland.com... >> Marcia wrote: >> >>> Hello ! >>> >>> My application need to show WER (Windows Error Reporting) when an >>> access violation occurs in Vista. >>> >>> A developer said to me that is not necessary to write code to receive >>> this behavior from my application. But, I made a kind of "Hello >>> World" application in both environments: >>> >>> -using .net it works perfectly. The screen was show and I saw a >>> Windows Error Report message in Event Viewer. >>> >>> -using Delphi 6 I received a Access Violation message but not a >>> Windows Error Reporting message e nothing occurs in Event Viewer. >>> >>> I saw a code sample in C++ where the guy was accessing the WERAPI.h >>> at the header. >>> >>> >>> Is there someone can help me? >> >> The standard Delphi VCL application traps all exceptions internally and >> passes them (if they are not handled by a try..except handler closer to >> its standard trap) to Application.HandleException. That fires the >> Application.OnException event, if there is a handler for it, or shows >> the exception dialog. As I understand it the Vista WER report (one of >> the most useless features ever invented IMO <g>) only handles >> exceptions that propagate into Windows API code. The VCL is explicitely >> designed to prevent that from ever happening, since it tends to kill >> the application stone dead, with no chance of recovery. >> >> If you find a way to call the appropriate API the >> Application.OnException event would be the one to call it from. But you >> have a problem if the API then terminates the process forcefully, since >> no cleanup would get done in this case. It is *much* preferrable to >> just show or log the error and then exit the application in a >> controlled manner, e.g. by calling Application.Terminate or by closing >> the main form. >> >> -- >> Peter Below (TeamB) >> Don't be a vampire (http://slash7.com/pages/vampires), >> use the newsgroup archives : >> http://www.tamaracka.com/search.htm >> http://groups.google.com > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads