Console output

I have a few window console applications written using Express VC++ Beta2 which sent output to a window within the IDE (I forgot what that window called, Quick Output?) when using "cout<<", "cerr<<" etc. I just uninstalled all the Beta products and installed VC++ express released version. I can not find that output window any more, all output produced by cout, cerr are sending to a seperate console window.

Can I still send these output to a window within the IDE? Or is this feature removed from Beta2?

[527 byte] By [JL3] at [2007-12-17]
# 1
Unfortunately, I believe that this feature was indeed removed. See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=133323&SiteID=1 for more details and a workaround using System.Diagnostics.Debug.Write().
justingrant at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 2
That's too bad. Wonder what was the reason behind the removal!

To use System.Diagnostics.Debug.Write(), it has to be a .NET app, right? All my apps are just plain Win32 Console.

Can I then remove VC++ RC and reinstall VC++ Beta2, with .NET 2 RC already installed? Will VC++ Beta2 work with .Net2 RC?

JL3 at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...
# 3
For Win32, you can use OutputDebugString
(http://msdn.microsoft.com/library/en-us/debug/base/outputdebugstring.asp), which is the Win32 equivalent of System.Diagnostics.Debug.Write().

For added fun, I found this article (http://dogma.net/markn/articles/ConStream/constream.htm) which looks like a head start for wrapping debug output into an STL-compatible iostream implementation so you can get the << operator to work, so in theory you could implement a new stream class which calls OutputDebugString and then do a search-and-replace for cout and replace with your new class. [I'm admittedly a novice at STL, so no guarantees on this!]

I suspect there's also a way to replace cout with your own custom stream if you really wanted to be lazy and not change your console output code at all. :-)

Not sure why the feature was removed. The other thread I linked to above is the best place to ask why. Not sure whether removing RC or RTM and restoring Beta2 will work-- but given all the other fixes between Beta2 and now, I'd recommend sticking with the RTM product, since all the samples and advice you'll get will assume use of the RTM builds. You'll likley end up spending more time chasing already-fixed bugs than it's worth in keeping the convenient debug-output feature you like...

justingrant at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Installing and Registering Visual Studio 2005 Express Editions...