Deactivate windows MessageBox dialog on exception

Gregor Mückl gregormueckl at gmx.de
Wed Aug 28 13:26:46 UTC 2019


On Wednesday, 28 August 2019 at 13:15:14 UTC, a11e99z wrote:
> On Wednesday, 28 August 2019 at 12:19:54 UTC, Andre Pany wrote:
>> Hi,
>>
>> I call another process using function pipeShell and 
>> Redirect.all.
>>
>
> import std;
>
> void main()
> {
>     auto p = pipeShell("a.exe", Redirect.all);
>     p.stdin.writeln("e1");
>     p.stdin.writeln("10");
>     p.stdin.writeln("e2");
>     p.stdin.writeln("9");
>
>     p.stdin.flush();
>     p.stdout.readln.writeln;
>
>     import core.thread: Thread;
>     import core.time: seconds;
>
>     Thread.sleep(2.seconds);
>     p.stdin.close;
>     p.stderr.byLineCopy.writeln;
>     Thread.sleep(1.seconds);
>     try {
> 	p.pid.kill; // Windows exception here "Access denied"
>     	p.pid.wait; // but no more MessageBox
>     } catch (Throwable) { }
> }

This isn't the problem, is it? It's the D runtime throwing up a 
message box for an uncaught D exception if it doesn't get caught 
inside main() and there is no console attached.


More information about the Digitalmars-d-learn mailing list