MISC 2: Windows has a right to stdout, enable it for both Digital Lab or Debug builds

This commit is contained in:
vsonnier 2016-06-09 19:21:43 +02:00
parent 4ec08b8b68
commit e7531952fe
1 changed files with 17 additions and 12 deletions

View File

@ -24,6 +24,8 @@
IMPLEMENT_APP(CubicSDR) IMPLEMENT_APP(CubicSDR)
#include <fstream>
//#ifdef ENABLE_DIGITAL_LAB //#ifdef ENABLE_DIGITAL_LAB
//// console output buffer for windows //// console output buffer for windows
//#ifdef _WINDOWS //#ifdef _WINDOWS
@ -156,18 +158,21 @@ bool CubicSDR::OnInit() {
return false; return false;
} }
//#ifdef ENABLE_DIGITAL_LAB // // console output for Windows: available in DEBUG or in case of ENABLE_DIGITAL_LAB
// // console output for windows #if (defined(WIN32) && (defined(ENABLE_DIGITAL_LAB) || defined(_DEBUG)))
// #ifdef _WINDOWS if (AllocConsole()) {
// if (AllocConsole()) { freopen("CONOUT$", "w", stdout);
// freopen("CONOUT$", "w", stdout); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
// SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED); SetConsoleTitle(L"CubicSDR: stdout");
// }
// outbuf ob; }
// std::streambuf *sb = std::cout.rdbuf(&ob);
// std::cout.rdbuf(sb); //refresh
// #endif ofstream ob;
//#endif std::streambuf *sb = std::cout.rdbuf();
std::cout.rdbuf(sb);
#endif
wxApp::SetAppName("CubicSDR"); wxApp::SetAppName("CubicSDR");