From 6abc599ddfe0a7a33bd420094277bd78142f4e2b Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Mon, 14 Aug 2017 21:14:34 -0400 Subject: [PATCH] added code to help debug issue #6: made Win32 app show stdout and stderr, if and when it is run from a command prompt window --- BasiliskII/src/Windows/main_windows.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BasiliskII/src/Windows/main_windows.cpp b/BasiliskII/src/Windows/main_windows.cpp index 45d50a7e..9fa4e1c0 100755 --- a/BasiliskII/src/Windows/main_windows.cpp +++ b/BasiliskII/src/Windows/main_windows.cpp @@ -212,6 +212,13 @@ int main(int argc, char **argv) char str[256]; bool cd_boot = false; + // Make sure stdout and stderr gets displayed, if and when the app is run + // via a command prompt window. + if (AttachConsole(ATTACH_PARENT_PROCESS)) { + freopen("CONOUT$", "w", stdout); + freopen("CONOUT$", "w", stderr); + } + // Initialize variables RAMBaseHost = NULL; ROMBaseHost = NULL;