Problem using AllocConsole() and marshalling
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.
精彩评论