🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages Started by Goran Ekstrom Tue, 06 Mar 2007 20:45
Behaviour of a crashing TThread
#2362
Author: Goran Ekstrom
Date: Tue, 06 Mar 2007 20:45
7 lines
1194 bytes
Hi,
I seem to remember that a crashing TThread does not pop up the familiar 
"Application problem" message box but just silently "dies" in the 
background. Correct? If so, how do you catch crashes in threads?

Thanks
Goran Ekstrom 
Re: Behaviour of a crashing TThread
#2363
Author: Remy Lebeau (TeamB)
Date: Tue, 06 Mar 2007 21:53
22 lines
1779 bytes
"Goran Ekstrom" <goek!removeantispam!@telia.com> wrote in message
news:45edd2bc$1@newsgroups.borland.com...

> I seem to remember that a crashing TThread does not pop up
> the familiar "Application problem" message box but just silently
> "dies" in the background. Correct?

Yes, that is correct.

> If so, how do you catch crashes in threads?

Wrap your Exceute() code with a try..catch block.  If you are using
BCB 6+, you can alternatively override the virtual DoTerminate()
method and check if the thread's FatalException property is NULL or
not.  If you are using BCB 5 or earlier, you can still override
DoTerminate(), but there is no FatalException property, so you would
need to use your own variable that Execute() can set if it exits
gracefully.


Gambit
Re: Behaviour of a crashing TThread
#2300
Author: Goran Ekstrom
Date: Fri, 09 Mar 2007 23:14
30 lines
1871 bytes
Excellent, thanks Remy.

Goran

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> skrev i meddelandet 
news:45ede2e2$1@newsgroups.borland.com...
>
> "Goran Ekstrom" <goek!removeantispam!@telia.com> wrote in message
> news:45edd2bc$1@newsgroups.borland.com...
>
>> I seem to remember that a crashing TThread does not pop up
>> the familiar "Application problem" message box but just silently
>> "dies" in the background. Correct?
>
> Yes, that is correct.
>
>> If so, how do you catch crashes in threads?
>
> Wrap your Exceute() code with a try..catch block.  If you are using
> BCB 6+, you can alternatively override the virtual DoTerminate()
> method and check if the thread's FatalException property is NULL or
> not.  If you are using BCB 5 or earlier, you can still override
> DoTerminate(), but there is no FatalException property, so you would
> need to use your own variable that Execute() can set if it exits
> gracefully.
>
>
> Gambit
>
> 
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