tags:

views:

66

answers:

3

Hi,

I want to print messages onto the console screen from a C++ DLL. The front end for this application is in C#. I used AllocConsole() fundtion to create a console from the C++ DLL. The window is being created but no messages were being printed when I try to print a message. Please help me fix this problem.

Thanks, Rakesh.

A: 

In your case you'd have to check this: http://www.halcyon.com/~ast/dload/guicon.htm

Vinzenz
A: 

If you are using printf I think you should also set the stdout handle using SetStdHandle. See http://www.codeguru.com/forum/showthread.php?t=267713)

Patrick
A: 

You need to redirect your output stream to the newly created console.

freopen("conin$", "r+t", stdin);  
freopen("conout$", "w+t", stdout);  
freopen("conout$", "w+t", stderr);
YeenFei
Thanks Fei. It works now.
Rakesh K