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

ID Number: Q75612

1.00

WINDOWS

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 that 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 Microsoft Professional Toolkit for Microsoft Visual Basic version

1.0 for Windows.

More Information:

CVW.EXE, CodeView for Windows, is distributed with the Microsoft

Windows Software Development Kit (SDK).

CVW can be a useful tool for debugging DLLs and custom controls

written for a Visual Basic program.

CVW 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 CVW 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 on 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 CVW 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

will be 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 on the circle. When your breakpoint is encountered,

focus will be set to CVW and execution will stop at your

breakpoint. You can now step through your program.

11. Press F5 to return to the Visual Basic program.

Reference(s):

"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 3.00