Link to home
Start Free TrialLog in
Avatar of boomerang061797
boomerang061797

asked on

MS VC++ 6.0: Output window instead of DOS prompt console?

Is it possible to configure the editor to use the "Output window" at the bottom of the screen instead of the DOS prompt window (console applications) for program output while debugging?
ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of boomerang061797
boomerang061797

ASKER

Actually I mean configure. With this I mean that I wish the program output to be produced in the output window. The OutputDebugString() will probably work too. Could you give an example (#includes, etc.)
There is nothing special to be done.  Just include windows.h as you would in any windows program.   Then just pass a string to the procedure, like

OutputDebugString("Appears in output window")'

You can place newline characters (\n) inside the string to force a line break.  
Actually I mean configure. With this I mean that I wish the program output to be produced in the output window. The OutputDebugString() will probably work too. Could you give an example (#includes, etc.)
It works, but the text is written to the same panel as the Compiler/Linker uses. Is there a way to open a dedicated panel like the Profile, Compiler/Linker, Find in files, SQL Debugging etc use.

What is the Results panel used for?
>> Is there a way to open a dedicated panel l
No.  Or at least I really doubt it.  It is possible to create add-ins for vissual studio that can add panes to the window, but I don't think there would be a way to redirect the debug information to a different pane.

Results panel used for?
It displays database querry results, maybe other things.
I've been trying it out and it seems like a handy feature. The only thing I don't understand is why (when in debugging mode) the output is written to the Debug panel when I step through the program, but not when I run the program in debugging mode.

My code is:

#ifdef _DEBUG
  OutputDebugString("Debugging string\n");
#endif

Surly the _DEBUG is defined when the program is compiled in debug mode so why no output when not stepping.
Are you sure it isn't being written?  When the program ends, a lot of stuff gets written to that window.  So it is possible that your messages have scrolled up off the top of the window.  

(I use this to trace progress through my program and definitely see the messages even when not single-stepping..)
No my window is always blank until I step the program.
Do you have another debugger on that system?  like maybe a hardware debugger like periscope or soft-ice?
No, just the standard Enterprise setup on a local machine.
I don't understand that.  It works for me.