Microsoft KB Archive/95180

= Getting Started with CodeView in Visual Basic for MS-DOS =

PSS ID Number: 95180

Article Last Modified on 1/8/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q95180



SUMMARY
The CodeView debugger that comes with the Professional Edition of Visual Basic for MS-DOS is useful for debugging mixed language programs. Do not use it with a program written completely in Visual Basic for MS-DOS. The VBDOS.EXE interpreter environment is more suited for that purpose.

The following information is a supplement to Chapter 10 of the Professional Edition of the &quot;Microsoft Visual Basic for MS-DOS Professional Features&quot; manual.



MORE INFORMATION
The first Step in preparing your program for the CodeView debugger is to compile each module in your program with the /Zi option. This includes non-Basic modules. You can compile Basic modules with this option from the interpreter environment by choosing Make EXE File from the Run menu and adding the /Zi option under Additional Options. Note, you must have saved your source files as text or you get a compile-time error.

When you use LINK to link your program together, you must use the /CO option. The interpreter environment adds this option automatically if you added the /Zi option, but you may not be able to debug your program correctly because of the other additions the environment makes, so it's a good idea to link it from the MS-DOS command prompt with the /CO option:

LINK /CO PROGRAM.OBJ;

After your program is compiled, start CodeView by typing CV followed by the name of your executable program:

CV PROGRAM.EXE

Once in the CodeView environment, load the code module that contains the code you want to debug. To do this, from the File menu, choose Open Module and select the module that contains the code you want to debug. Once the code is in view, set a breakpoint by pressing the F9 key on the specific line of code where you want execution to stop. If the source code line you choose can't have a breakpoint, the computer will beep when you try to put a breakpoint on it.

When debugging the code in a form, you must scroll down past the property and control definitions (BEGIN ... END).

Now you are ready to debug your program. To start your program, press the F5 key just as you would in the VBDOS.EXE interpreter environment. When execution reaches your breakpoint, your program halts and the source window is displayed. To step through this part of your program, press the F8 key just as you would in the VBDOS.EXE interpreter environment.

For more information, see Chapter 10 of the Professional Edition of the &quot;Microsoft Visual Basic for MS-DOS Professional Features&quot; manual.

Additional query words: VBmsdos 1.00 s_codeview 4.02

Keywords: KB95180

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.