Article ID: 107428 - Last Review: October 24, 2003 - Revision: 2.0 FIX: Extra New Line Added to Debug Output in Visual DebuggerThis article was previously published under Q107428 On This PageSYMPTOMS
When using the Visual Workbench debugger, a new line is inserted in
the debugging output window every time debugging information is output
through the CDumpContext insertion operator or OutputDebugString().
This interferes with formatting done for the debug output.
CAUSE
A new line is inserted by the debugger after every call to the Windows
3.1 application programming interface (API) function
OutputDebugString(). In the Microsoft Foundation Classes (MFC), the
insertion operator (<<) for CDumpContext eventually maps to a call to
OutputDebugString(), so every invocation of << for a CDumpContext
object also introduces a new line in the output window.
RESOLUTION
The following are three suggested workarounds:
STATUS
Microsoft has confirmed this to be a bug in the products listed at the
beginning of this article. This problem was corrected in Visual C++ 2.0.
MORE INFORMATION
The following code fragment demonstrates the problem that occurs when
calling OutputDebugString directly. The output that would normally
appear on the same line actually displays over three lines:
CodeOutputThis output takes three lines.
a
CObject
at
$18FC80
FirstName LastName
is
30
years old.
a CObject at $3917477E FirstName LastName is 30 years old. | Article Translations
|

Back to the top
