AttachConsole Error 5: Access is denied

后端 未结 1 500
温柔的废话
温柔的废话 2021-01-15 13:51

I\'m working with a C++ Console Application in Visual Studio 2013, working on Windows.

First I detached the console using FreeConsole, it works; then, c

1条回答
  •  北荒
    北荒 (楼主)
    2021-01-15 14:24

    Remove the AllocConsole call before AttachConsole.

    From the documentation: A process can be attached to at most one console. If the calling process is already attached to a console, the error code returned is ERROR_ACCESS_DENIED (5).

    0 讨论(0)
提交回复
热议问题