38bab59c1afa850a7fc532540607517274970c75
- When started from the console use the console (when no --console) - When started from the GUI (with --console) open a new console window - When started from the GUI (without --console) don't open a new console window; stdout/stderr will not appear (except in logfiles as they do now). This opens stderr/stdout on the NUL device to alleviate any potential issues - When started from the Console (with --console) open a new console window - Ensure that IO redirection still works when started from the console. When redirecting stdout stderr will also be redirected (providing it wasn't already via 2>&1) - otherwise output from stderr will be lost. - When using redirection from the command prompt --console will produce an error message box. Notes: - fgfs needs to be a linked as Win32 GUI subsystem app - which it already is - What can't be done is to make the cmd prompt run fgfs synchronously; this is only something that can be done via "start /wait fgfs" Basically the way that Win32 works is quite sensible, but slightly at odds with the unix nature of the C-RTL; so the standard streams sort of get lost for GUI apps. AttachConsole and AllocConsole are provided to address this - but they do slightly different things. AttachConsole will attach to the cmd.exe (or any console related to the parent process), whereas AllocConsole will open a new one. Depending on where the application was launched from it makes sense to use AttachConsole for a cmd.exe launch and do nothing (unless --console is given) for a GUI launch. Redirection is not available from the GUI (unless set in the Process Create block) - so really only available when launched from the command line. If any stream is redirected then all must be otherwise it appears that AttachConsole will undo the redirection by changing the standard handles.
SimGear - Simulator Construction Tools ====================================== http://www.flightgear.org SimGear is a set of open-source libraries designed to be used as building blocks for quickly assembling 3d simulations, games, and visualization applications. SimGear is developed by the FlightGear project and also provides the base for the FlightGear Flight Simulator. Source code for SimGear is released under the GNU Library General Public License (LGPL) - see COPYING for license details. See INSTALL file for help on building SimGear.
Languages
C++
85.5%
C
13.1%
CMake
1.4%