1
Lix Main / Re: Error logging on Windows
« on: May 05, 2024, 09:11:38 PM »
I'm asking on the D forums: Does the D runtime support generating an error box for uncaught exceptions?
I don't believe it does. We'll generate the message box by hand.
I'll put this in the catch-all that logs uncaught exceptions, then terminates Lix. Now, every time we log an uncaught exception on Windows, we'll also display an error box.
The box doesn't know about the Allegro 5 window (= Lix's main window). You can bring the hanging Lix window into the foreground, obscuring the modal box. Possible future investigation: Pass the Allegro 5 window instead of null for the first argument to MessageBoxW() and look at how the box interacts with the Lix window.
-- Simon
I don't believe it does. We'll generate the message box by hand.
Code: [Select]
version (Windows) {
import core.sys.windows.windows;
const wstring messageBody = /* ... */
MessageBoxW(null, messageBody.ptr, null, MB_ICONERROR);
}
I'll put this in the catch-all that logs uncaught exceptions, then terminates Lix. Now, every time we log an uncaught exception on Windows, we'll also display an error box.
The box doesn't know about the Allegro 5 window (= Lix's main window). You can bring the hanging Lix window into the foreground, obscuring the modal box. Possible future investigation: Pass the Allegro 5 window instead of null for the first argument to MessageBoxW() and look at how the box interacts with the Lix window.
-- Simon