BUG: Screen Corruption Can Occur with _setvideomode()

Last reviewed: July 22, 1997
Article ID: Q116462
4.00 4.01 4.10 MS-DOS kbtool kbcode kbbuglist

The information in this article applies to:

  • Microsoft CodeView for MS-DOS, versions 4.0, 4.01, and 4.1

SYMPTOMS

When the CodeView video mode is set to be the same as the current MS-DOS video mode, calls to _setvideomode(_DEFAULTMODE) can cause screen corruption.

RESOLUTION

To work around the problem, start CodeView in a different mode than the one MS-DOS is using.

STATUS

Microsoft has confirmed this to be a bug with CodeView for MS-DOS. We are researching this problem and will post new information in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The sample code below demonstrates the problem. Build a debug version and follow these steps:

  1. Install the ANSI.SYS driver. If ANSI.SYS is not already installed, you have to reboot your computer to install it. To install ANSI.SYS, add the following line to your CONFIG.SYS file:

          DEVICE=C:\DOS\ANSI.SYS
    

  2. Enter "mode co80, 50" at the MS-DOS prompt.

  3. Enter "CV /50 VIDEO" to debug the VIDEO.EXE file in CodeView.

  4. Type "t3" in the CodeView command window.

There should now be a green border around the whole screen that does not go away when you exit CodeView. You may also experience a certain amount of text loss in the CodeView windows.

NOTE: Reissuing the mode command with different mode values at the MS-DOS prompt restores the screen.

In step 2 above, using "CV /43 video" or "CV /25 video" (without the quotes) prevents this problem from occurring.

Sample Code

/* Compile options needed: Zi /Od
*/

/* VIDEO.C */

   #include <graph.h>

   void main(void)
   {
    _setvideomode(_DEFAULTMODE);
   }


Additional reference words: 4.00 4.10
KBCategory: kbtool kbcode kbbuglist
KBSubcategory: CvwIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.