use stderr in wxMessageOutputBest::Printf() even under Windows if it's available (patch 1216159)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -102,10 +102,17 @@ void wxMessageOutputBest::Printf(const wxChar* format, ...)
|
|||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
::MessageBox(NULL, out, _T("wxWidgets"), MB_ICONINFORMATION | MB_OK);
|
// check if we're running in a console
|
||||||
#else // !__WINDOWS__
|
HANDLE hStdErr = ::GetStdHandle(STD_ERROR_HANDLE);
|
||||||
fprintf(stderr, "%s", (const char*) out.mb_str());
|
if ( !hStdErr || hStdErr == INVALID_HANDLE_VALUE )
|
||||||
|
{
|
||||||
|
::MessageBox(NULL, out, _T("wxWidgets"), MB_ICONINFORMATION | MB_OK);
|
||||||
|
}
|
||||||
|
else
|
||||||
#endif // __WINDOWS__/!__WINDOWS__
|
#endif // __WINDOWS__/!__WINDOWS__
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s", (const char*) out.mb_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user