| 8 | #include <iostream> |
| 9 | |
| 10 | void CreateAndAttachConsole() { |
| 11 | if (::AllocConsole()) { |
| 12 | FILE *unused; |
| 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { |
| 14 | _dup2(_fileno(stdout), 1); |
| 15 | } |
| 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { |
| 17 | _dup2(_fileno(stdout), 2); |
| 18 | } |
| 19 | std::ios::sync_with_stdio(); |
| 20 | FlutterDesktopResyncOutputStreams(); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | std::vector<std::string> GetCommandLineArguments() { |
| 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. |