Where does Console::write() output text appear?

G

Guest

Hi. I've got a C++ program written in Visual C++ 2003. The program is
trivial, created with the Program-creation wizard: used the .NET "Form"
template. The program has a trivial single-pane form GUI.

I've got some stdout print statements in the code ... but I cannot find
where in the world the output text is appearing. For printing I tried both:

printf ("Hello world\n");
and
Console::Write ("Hello World\n");

I was expecting the output text to appear in the Visual C++ "Output" window:
there are two choices there: Debug and Build, but my output text is in
neither.

I understand that my program is not, strictly speaking, a "console program",
but certainly there must be a way to write text to stdout and veiw it?

Question: Where does output text appear when written with Console::Write()
or printf()?
 
C

Carl Daniel [VC++ MVP]

noleander said:
Hi. I've got a C++ program written in Visual C++ 2003. The program
is trivial, created with the Program-creation wizard: used the .NET
"Form" template. The program has a trivial single-pane form GUI.

I've got some stdout print statements in the code ... but I cannot
find where in the world the output text is appearing. For printing
I tried both:

printf ("Hello world\n");
and
Console::Write ("Hello World\n");

I was expecting the output text to appear in the Visual C++ "Output"
window: there are two choices there: Debug and Build, but my output
text is in neither.

I understand that my program is not, strictly speaking, a "console
program", but certainly there must be a way to write text to stdout
and veiw it?

Question: Where does output text appear when written with
Console::Write() or printf()?

It goes to stdout, which would be the console if you'd developed a console
program. If you run under the debugger, stdout from WinForms app goes to
the Output window in the debugger. If you're not running under the
debugger, it goes to the bit bucket. In an unmanaged Windows application
(non-console application) it goes to the bit bucket unless you send it
somewhere else (WinForms does it for you - in native code, you're on your
own).

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top