PRB: Using OutputDebugString() with no '\n' can GPF
PSS ID Number: Q114152
Article last modified on 08-29-1994

1.50

WINDOWS


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft Visual C++ for Windows, version 1.50
----------------------------------------------------------------------

SUMMARY
=======

Using the Windows API OutputDebugString() while in a Visual Workbench
debugging session can cause a number of problems if the debugging
output is directed to the "Output" window. Passing long strings or
making many successive calls without using the new-line character
('\n') can result in a GPF or hang your system.

In addition, on Windows NT systems, the two message boxes

  System is unstable.  Debugging session will terminate.

and

  The text cannot be inserted.
  The line length would exceed 251 characters.

may appear followed by Visual C++ hanging.

CAUSE
=====

The 251 character per line limit of the Output Window was exceeded.

RESOLUTION
==========

You can either use the DBWIN utility provided in Visual C++ or install
the patch described below.

Microsoft has released a patch to Visual C++ 1.5 which will eliminate
the problems with OutputDebugString().  The debugger will automatically
truncate the strings passed to it's output Window so that they don't
exceed the limit mentioned above. This patch will modify the Visual
Workbench 1.5, updating the version number to 1.50.01. VC1501.EXE can be
downloaded as a self-extracting file from the Microsoft Software Library
(MSL) on the following services:

 - CompuServe
      GO MSL and download S14740.EXE, or you can download VC1501.EXE
      from download library 7 or 12 of the MSLANG forum.

 - Microsoft Download Service (MSDL)
      Dial (206) 936-6735 to connect to MSDL
      Download VC1501.EXE.

 - Internet (anonymous FTP)
      ftp ftp.microsoft.com
      Change to the \softlib\mslfiles directory
      Get VC1501.EXE.
      It can also be found in \developer\devtools\lang\msvcwin\public.

 - If you don't have access to the above services you may contact Microsoft
   Developer Support following the procedures outlined in the Obtaining
   Technical Support option on the Help menu of the Visual Workbench.

This patch also fixes a problem with the Workbench unnecessarily
placing a DLL in low memory ( below 1 Meg ) and fixing it there.
For more information on this problem you can query in the Microsoft
KnowledgeBase on the following keywords:

Low and Memory and Workbench and 1.5 and patch

You should only apply this patch if you are running into one of these
problems specifically since it only makes these two changes to the
Workbench.

Additional reference words: 252 General Protection Fault
KBCategory: Tls
KBSubCategory: WBDebug

=============================================================================

Copyright Microsoft Corporation 1994.
