Output to stderr in Poco::WindowsConsoleChannel (#3058)

- Fixes #3056
This commit is contained in:
Fritz Elfert
2022-05-30 04:48:41 +02:00
committed by GitHub
parent f860c26b3d
commit 1f587cfd3b

View File

@@ -26,7 +26,7 @@ WindowsConsoleChannel::WindowsConsoleChannel():
_isFile(false),
_hConsole(INVALID_HANDLE_VALUE)
{
_hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
_hConsole = GetStdHandle(STD_ERROR_HANDLE);
// check whether the console has been redirected
DWORD mode;
_isFile = (GetConsoleMode(_hConsole, &mode) == 0);
@@ -63,7 +63,7 @@ WindowsColorConsoleChannel::WindowsColorConsoleChannel():
_isFile(false),
_hConsole(INVALID_HANDLE_VALUE)
{
_hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
_hConsole = GetStdHandle(STD_ERROR_HANDLE);
// check whether the console has been redirected
DWORD mode;
_isFile = (GetConsoleMode(_hConsole, &mode) == 0);