I just have a simple console application written in C... is there a
simpler way to do this? I remember a while back there was a simple
function like DebugMessage or LogMessage or something like that, which
just wrote the input to the console window of the visual C debugger...
is there still something like that available?
I don't understand your question. Your original post, to me, implied that
you had debug messages already in the Output window, and you wanted to
display them somewhere else (like print them, for example).
While OutputDebugString() works in some contexts, it's not the .NET way to
do things. There is a perfectly good, just-as-easy-to-use Debug class
that is available in .NET. If you are simply trying to find out how to
get messages to the Output window in the first place, then Debug.Write()
and Debug.WriteLine() are what you want.
I cannot imagine anything being simpler. OutputDebugString() certainly is
no simpler (though it's not much more complicated either).
If you then also want those messages logged elsewhere somehow, you can add
a TraceListener to the Debug.Listeners collection. Perhaps you don't need
this, but if you do it's simple to add. Assuming you are using the .NET
Debug class in the first place, of course.
Pete