How to redirect qml's console.log() to cpp stdout
问题 I am using qml( qtCreator ) and cpp (visual studio). Usually the error messages are shown to the console, both from cpp and qml. My requirement is that I should not have a console. So I wrote a window application. But when a flag has been set, I should launch a console. And show the corresponding error messages there. I have used the following code in a function to set up this. HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE); int hCrt = _open_osfhandle((long) handle_out, _O_TEXT); FILE*