Re: Silent error when using hashmap

2017-07-27 Thread FatalCatharsis via Digitalmars-d
On Thursday, 27 July 2017 at 14:09:37 UTC, Mike Parker wrote: 1. You can't expect exceptions thrown in a callback called from C to be propagated through the C side back into the D side. That includes errors. It happens on some platforms, but not all. On Windows, it does not (at least, not with

Re: Silent error when using hashmap

2017-07-27 Thread Mike Parker via Digitalmars-d
On Thursday, 27 July 2017 at 00:07:39 UTC, FatalCatharsis wrote: I figured this was the case. WM_NCCREATE is probably sent first and the lookup fails. I'm more concerned with why there was no exceptions/debug output of any kind. There are a few things going on with your code. I'll break it

Re: Silent error when using hashmap

2017-07-27 Thread Steven Schveighoffer via Digitalmars-d
On 7/26/17 10:30 PM, FatalCatharsis wrote: On Thursday, 27 July 2017 at 01:21:40 UTC, Steven Schveighoffer wrote: the writeln("start"); and writeln("end"); in main. This is what I meant by printing. These do not appear in the output. The programs starts and immediately ends without printing

Re: Silent error when using hashmap

2017-07-26 Thread FoxyBrown via Digitalmars-d
On Thursday, 27 July 2017 at 02:30:17 UTC, FatalCatharsis wrote: On Thursday, 27 July 2017 at 01:21:40 UTC, Steven Schveighoffer wrote: [...] This appears to be it. When an error is thrown, stdout does not flush. When I put stdout.flush() immediately after the writeln("start") at the

Re: Silent error when using hashmap

2017-07-26 Thread FatalCatharsis via Digitalmars-d
On Thursday, 27 July 2017 at 01:21:40 UTC, Steven Schveighoffer wrote: the writeln("start"); and writeln("end"); in main. This is what I meant by printing. These do not appear in the output. The programs starts and immediately ends without printing "start" and "end". try flushing the output.

Re: Silent error when using hashmap

2017-07-26 Thread Steven Schveighoffer via Digitalmars-d
On 7/26/17 8:51 PM, FatalCatharsis wrote: On Thursday, 27 July 2017 at 00:48:48 UTC, ketmar wrote: FatalCatharsis wrote: On Thursday, 27 July 2017 at 00:34:28 UTC, ketmar wrote: wrap the whole event handler function in `try/catch` block, and print it there. after all, this is what Dmain

Re: Silent error when using hashmap

2017-07-26 Thread ketmar via Digitalmars-d
FatalCatharsis wrote: On Thursday, 27 July 2017 at 00:48:48 UTC, ketmar wrote: FatalCatharsis wrote: On Thursday, 27 July 2017 at 00:34:28 UTC, ketmar wrote: wrap the whole event handler function in `try/catch` block, and print it there. after all, this is what Dmain does, and so can you.

Re: Silent error when using hashmap

2017-07-26 Thread FatalCatharsis via Digitalmars-d
On Thursday, 27 July 2017 at 00:48:48 UTC, ketmar wrote: FatalCatharsis wrote: On Thursday, 27 July 2017 at 00:34:28 UTC, ketmar wrote: wrap the whole event handler function in `try/catch` block, and print it there. after all, this is what Dmain does, and so can you. having *full* stack

Re: Silent error when using hashmap

2017-07-26 Thread ketmar via Digitalmars-d
FatalCatharsis wrote: On Thursday, 27 July 2017 at 00:34:28 UTC, ketmar wrote: wrap the whole event handler function in `try/catch` block, and print it there. after all, this is what Dmain does, and so can you. having *full* stack trace has no sense there anyway, as you know for sure that

Re: Silent error when using hashmap

2017-07-26 Thread ketmar via Digitalmars-d
FatalCatharsis wrote: On Thursday, 27 July 2017 at 00:34:28 UTC, ketmar wrote: wrap the whole event handler function in `try/catch` block, and print it there. after all, this is what Dmain does, and so can you. having *full* stack trace has no sense there anyway, as you know for sure that

Re: Silent error when using hashmap

2017-07-26 Thread FatalCatharsis via Digitalmars-d
On Thursday, 27 July 2017 at 00:34:28 UTC, ketmar wrote: wrap the whole event handler function in `try/catch` block, and print it there. after all, this is what Dmain does, and so can you. having *full* stack trace has no sense there anyway, as you know for sure that event handler is called by

Re: Silent error when using hashmap

2017-07-26 Thread ketmar via Digitalmars-d
FatalCatharsis wrote: On Thursday, 27 July 2017 at 00:12:20 UTC, ketmar wrote: 'cause windows' event handler called from darkes depths of windows code, and D just can't make sense of the stack to unwind it properly and to show you error message and stack trace. never ever rely on getting

Re: Silent error when using hashmap

2017-07-26 Thread FatalCatharsis via Digitalmars-d
On Thursday, 27 July 2017 at 00:12:20 UTC, ketmar wrote: 'cause windows' event handler called from darkes depths of windows code, and D just can't make sense of the stack to unwind it properly and to show you error message and stack trace. never ever rely on getting proper stack traces for

Re: Silent error when using hashmap

2017-07-26 Thread ketmar via Digitalmars-d
FatalCatharsis wrote: On Wednesday, 26 July 2017 at 16:39:15 UTC, ketmar wrote:> 'cause `WM_CREATE` is not the first message window receiving. check if hwnd is in hash with `in` first. I figured this was the case. WM_NCCREATE is probably sent first and the lookup fails. I'm more concerned

Re: Silent error when using hashmap

2017-07-26 Thread FatalCatharsis via Digitalmars-d
On Wednesday, 26 July 2017 at 16:39:15 UTC, ketmar wrote:> 'cause `WM_CREATE` is not the first message window receiving. check if hwnd is in hash with `in` first. I figured this was the case. WM_NCCREATE is probably sent first and the lookup fails. I'm more concerned with why there was no

Re: Silent error when using hashmap

2017-07-26 Thread Steven Schveighoffer via Digitalmars-d
On 7/26/17 12:09 PM, FatalCatharsis wrote: I apologize, I'm not sure if this is expected behavior, a bug in the compiler, or a bug in the core windows libraries, so I'll post this here until pointed elsewhere. I've done this trick with win32 for awhile in other languages where I pass a

Re: Silent error when using hashmap

2017-07-26 Thread Mike Parker via Digitalmars-d
On Wednesday, 26 July 2017 at 16:09:30 UTC, FatalCatharsis wrote: When I compile this and run this, nothing is printed and no window is created. I've tried putting try catches around everything (including the inside of the static constructor), but nothing is caught. You're casting this to

Re: Silent error when using hashmap

2017-07-26 Thread ketmar via Digitalmars-d
FatalCatharsis wrote: I apologize, I'm not sure if this is expected behavior, a bug in the compiler, or a bug in the core windows libraries, so I'll post this here until pointed elsewhere. I've done this trick with win32 for awhile in other languages where I pass a reference to a specific

Silent error when using hashmap

2017-07-26 Thread FatalCatharsis via Digitalmars-d
I apologize, I'm not sure if this is expected behavior, a bug in the compiler, or a bug in the core windows libraries, so I'll post this here until pointed elsewhere. I've done this trick with win32 for awhile in other languages where I pass a reference to a specific class of my own that