1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added some init code to enable stdout, stderr, stdin in the special case that we run an non-console Windows app inside a Windows console such as cmd.exe or PowerShell.

This commit is contained in:
Timur Doumler 2016-05-04 18:40:41 +01:00
parent c9c6aa0a2d
commit 4c900be00a

View file

@ -257,6 +257,16 @@ bool JUCEApplicationBase::initialiseApp()
}
#endif
#if JUCE_WINDOWS && JUCE_STANDALONE_APPLICATION && ! defined (_CONSOLE)
if (AttachConsole (ATTACH_PARENT_PROCESS) != 0)
{
// if we've launched a GUI app from cmd.exe or PowerShell, we need this to enable printf etc.
freopen("CON", "w", stdout);
freopen("CON", "w", stderr);
freopen("CON", "r", stdin);
}
#endif
// let the app do its setting-up..
initialise (getCommandLineParameters());