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

Last reviewed: June 21, 1995
Article ID: Q75612
The information in this article applies to:
  • Standard and Professional Editions of Microsoft Visual Basic for Windows, versions 2.0 and 3.0
  • Microsoft Visual Basic programming system for Windows, version 1.0

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


Additional reference words: 1.00 2.00 3.00
KBCategory: kbenv kbprg
KBSubcategory: EnvtRun


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: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.