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):
- 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.
- 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 "c" 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 "IF" 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.
- Select the custom control from the toolbox and add it to your form.
- Press F5 to run your program.
- 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.
- 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