Is there any way to detect Access Violation through code and display an error
message?

--
Kostatus
kostatus001 at ihug co nz

Re: Access Violatioin detection by Mario

Mario
Mon May 10 04:57:20 CDT 2004


"Kostatus" <to.get.my.email@see.bottom.of.this.post> schrieb im Newsbeitrag
news:Xns94E5BCA0C6265Kostatus@203.109.252.31...
> Is there any way to detect Access Violation through code and display an
error
> message?
>

Kostatus, you're looking for win32 structured exception handling not to be
confused with C++ exception handling.
There's quite some information about that in MSDN. You might also want to
check out the CRT's eh.h header file and write yourself a handler for your
structured exception. Your handler would receive a pointer to an
EXCEPTION_POINTERS struct which you can use to get more information.
This way you can even translate structured exceptions into c++ exceptions
and treat them uniformly if you wish so.

--
Mario Topf.
www.speckdrumm.org



Re: Access Violatioin detection by andrea

andrea
Mon May 10 11:38:17 CDT 2004

yes there is.
use this (this is one way to handle) :

__try {
// code to protect here
}
__except ( EXCEPTION_EXECUTE_HANDLER ) {
// handling the exception
}

"Kostatus" <to.get.my.email@see.bottom.of.this.post> wrote in message
news:Xns94E5BCA0C6265Kostatus@203.109.252.31...
> Is there any way to detect Access Violation through code and display an
error
> message?
>
> --
> Kostatus
> kostatus001 at ihug co nz