开发者

Problem using AllocConsole() and marshalling

开发者 https://www.devze.com 2023-01-28 01:28 出处:网络
I\'ve got a C# application that calls a native C++ DLL (I control the source of both). I\'ve used AllocConsole() from the managed side, and then call into the native side. But the native code won\'t o

I've got a C# application that calls a native C++ DLL (I control the source of both). I've used AllocConsole() from the managed side, and then call into the native side. But the native code won't output to the console- nothing happens, even though there is most definitely a console available, since I just explicitly allocated one. The code works fine if I allocate a console before the first console output fr开发者_如何学编程om the native code, but if I try to allocate a console during only some std::cout calls, then it fails. Any ideas?


If your application is not linked to use the console subsystem, you have to hook it up yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消