No console output when using AllocConsole and target architecture x86

前端 未结 5 1341
-上瘾入骨i
-上瘾入骨i 2020-11-27 17:05

I have a WinForms project, and if the user want\'s a debug console, I allocate a console with AllocConsole().

All console output works normally with the

5条回答
  •  囚心锁ツ
    2020-11-27 17:48

    I also had this problem. Every time I tried to debug my app, the console was blank. Strangely, launching the exe without the debugger worked fine.

    I found that I had to Enable the Visual Studio hosting process from the project's Debug menu.

    Stephen is correct that Enable native code debugging does redirect the console to the Output window. However, regardless of the native code debugging setting, I saw absolutely no output in either place until I enabled the Visual Studio hosting process.

    This could have been the reason that merely disabling native code debugging did not solve your issue.

提交回复
热议问题