[Issue 23312] Cannot use writeln with WinMain

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 25 11:13:14 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23312

Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com

--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> ---
My workaround for this is to use `main()` instead of `WinMain()`. It's still
possible to write GUI apps this way, and there will be a console spawned with
the app so the stdout/stderr handles are valid this way.

Maybe there's a way to spawn a console when using WinMain if one is not
detected.

Or alternatively it would be nice to be able to set stdout/stderr to a file
handle when using WinMain. Not sure if this is already possible.

--


More information about the Digitalmars-d-bugs mailing list