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



The information in this article applies to:

  • Microsoft Visual Basic Standard Edition for Windows 2.0
  • Microsoft Visual Basic Standard Edition for Windows 3.0
  • Microsoft Visual Basic Professional Edition for Windows 2.0
  • Microsoft Visual Basic Professional Edition for Windows 3.0
  • Microsoft Visual Basic Standard Edition for Windows 1.0

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 "/L" 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):

  1. 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 "Additional DLLs...". Specify the *.VBX file at this prompt. Skip to step 4.
  2. When CVW is loaded into the debug monitor, the following message is displayed:
    No Symbolic information for VB.EXE
  3. Choose the OK button to load the Visual Basic program.
  4. From the File menu, choose Open Module to load the CIRCLE3.VBX source code. You should see a list of "c" source code in the list box. Select CIRCLE.C, which corresponds to the CIRCLE3.VBX source code.
  5. Locate the WM_LBUTTONDBLCLK message and set a breakpoint on the first "IF" statement.
  6. Press F5 to run your Visual Basic program.
  7. From the File menu, choose Add File. In the Files box, select the CIRCLE3.VBX file. The CIRCLE3 tool appears in the toolbox.
  8. Select the custom control from the toolbox and add it to your form.
  9. Press F5 to run your program.
  10. 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.
  11. Press F5 to return to the Visual Basic program.

REFERENCES

"Programming Windows: the Microsoft Guide to Writing Applications for Windows 3," by Charles Petzold, Microsoft Press, 1990

"Peter Norton's Windows 3.0 Power Programming Techniques," by Peter Norton and Paul Yao, Bantam Computer Books, 1990

"Microsoft Windows Software Development Kit: Programming Tools," version 3.0

WINSDK.HLP file shipped with Microsoft Windows 3.0 Software Development Kit

Modification Type:MajorLast Reviewed:12/12/2003
Keywords:KB75612