Original Post
Ok, what hell is wrong here? I'm calling ::AllocConsole(), which doesn't report an error, then I'm calling ::SetConsoleTitle("title") which returns non-zero as well, and finally I'm calling ::GetStdHandle(STD_OUTPUT_HANDLE) which returns a valid handle (!=INVALID_HANDLE_VALUE). Why then printing to console or calling ::SetConsoleScreenBufferSize() fail with error ERROR_INVALID_HANDLE??