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:
parent
c9c6aa0a2d
commit
4c900be00a
1 changed files with 10 additions and 0 deletions
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue