Microsoft KB Archive/75612

= How to Use CodeView for Windows (CVW.EXE) with Visual Basic =

Article ID: 75612

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 1.0 Standard Edition

-



This article was previously published under Q75612



SUMMARY
You can use CodeView for Windows (CVW) to debug a dynamic link library (DLL) or custom control that is called from Visual Basic.

NOTE: You can build custom controls using the Control Development Kit (CDK) for Visual Basic. The Visual Basic CDK, formerly shipped separately as an add-on product from Microsoft, is now shipped as part of the Professional Edition of Microsoft Visual Basic for Windows.



MORE INFORMATION
CVW.EXE, CodeView for Windows, is distributed with the Microsoft Windows Software Development Kit (SDK). CodeView can be a useful tool for debugging DLLs and custom controls written for a Visual Basic program. CodeView takes the following command line arguments: [path]CVW.EXE /L [dynamic link library] [executable program] where:

[dynamic library] is your DLL or custom control.

[executable program] is the EXE that uses your DLL/custom control.

The &quot;/L&quot; option tells CVW that this is a DLL or custom control.

You can invoke CodeView from the Windows Program Manager in any of the following ways:


 * From the Windows Program Manager File menu, choose New, and specify CVW.EXE as a Program Item with proper arguments. You can then double-click the CVW icon to run CVW.EXE.
 * From the Windows Program Manager File menu, choose Run, and enter CVW.EXE and its command line arguments.
 * Invoke CodeView with no arguments, and at the prompts, enter the program name and DLL/VBX that you want to debug.

The example below demonstrates how to invoke CIRCLE3.VBX, which comes with the Microsoft Visual Basic Control Development Kit (CDK):

  Run CVW.EXE from the Program Manager as specified below. [path]CVW.EXE /L [path]CIRCLE3.VBX [path]VB.EXE NOTE: You can just specify an .EXE program that was written in the Visual Basic environment instead of specifying the VB.EXE environment itself. If you do this, skip steps 7, 8, and 9 below.

NOTE: If you invoke CVW.EXE with no command line arguments, CVW.EXE will prompt you for command line arguments. Specify the VB.EXE file that uses the *.VBX file. CVW.EXE will then prompt you for &quot;Additional DLLs...&quot;. Specify the *.VBX file at this prompt. Skip to step 4.  When CVW is loaded into the debug monitor, the following message is displayed:

No Symbolic information for VB.EXE

 Choose the OK button to load the Visual Basic program. From the File menu, choose Open Module to load the CIRCLE3.VBX source code. You should see a list of &quot;c&quot; source code in the list box. Select CIRCLE.C, which corresponds to the CIRCLE3.VBX source code. Locate the WM_LBUTTONDBLCLK message and set a breakpoint on the first &quot;IF&quot; statement. Press F5 to run your Visual Basic program. From the File menu, choose Add File. In the Files box, select the CIRCLE3.VBX file. The CIRCLE3 tool appears in the toolbox.</li> Select the custom control from the toolbox and add it to your form.</li> Press F5 to run your program.</li> Double-click the circle. When your breakpoint is encountered, focus will be set to CodeView and execution will stop at your breakpoint. You can now step through your program.</li> Press F5 to return to the Visual Basic program.</li></ol>

<div class="references_section">