Thread overview
catching access violations of external programs
Feb 12, 2005
Thomas Kühne
Feb 12, 2005
zwang
Feb 12, 2005
Thomas Kühne
February 12, 2005
Is there any way to catch access violations of external programs?

#
# int ret = system("runMe arg1 arg2");
#

The code above returns a defined value if runMe segfaults in a Unix
environment.

This doesn't work under Windows as it produces a pop up notifying the
user of the access violation. Is there any way to disable those pop ups
and guarantee a return to the calling program?

Thomas

February 12, 2005
Thomas Kühne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Is there any way to catch access violations of external programs?
> 
> #
> # int ret = system("runMe arg1 arg2");
> #
> 
> The code above returns a defined value if runMe segfaults in a Unix
> environment.
> 
> This doesn't work under Windows as it produces a pop up notifying the
> user of the access violation. Is there any way to disable those pop ups
> and guarantee a return to the calling program?
> 
> Thomas
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.0 (MingW32)
> 
> iD8DBQFCDe2q3w+/yD4P9tIRAkbXAJsFY7/3f1HBCsMkA83h/yWUBhwpnwCbBI+G
> 3p8vRwskmMoPSlpB7qS30dI=
> =47Ro
> -----END PGP SIGNATURE-----

I guess you'll have to call Windows API's like CreateProcess instead of
using std.c.process.system directly.
February 12, 2005
zwang wrote:

| Thomas Kühne wrote:
|
| Is there any way to catch access violations of external programs?
|
| #
| # int ret = system("runMe arg1 arg2");
| #
|
| The code above returns a defined value if runMe segfaults in a Unix
| environment.
|
| This doesn't work under Windows as it produces a pop up notifying the
| user of the access violation. Is there any way to disable those pop ups
| and guarantee a return to the calling program?

| I guess you'll have to call Windows API's like CreateProcess instead of
| using std.c.process.system directly.

I usually try to minimize the use of platform dependent functions...

Thanks,
Thomas