Article ID: 131007 - Last Review: July 15, 2004 - Revision: 2.1 How To Use Windows NT WinDbg.exe with Visual BasicThis article was previously published under Q131007 On This PageSUMMARY
Many Visual Basic application developers are moving to Windows NT as their
development platform because of its robustness and excellent multitasking
capabilities. This article shows by example how Visual Basic developers can
use the Windbg debugger to debug a dynamic link library (.DLL file) or
custom control (.VBX file) called from a Visual Basic application running
under Windows NT.
CodeView for Windows doesn't run under Windows NT because CodeView uses a VxD (Virtual Device Driver) not supported by Windows NT. For information on how to use CodeView for Windows to debug Visual Basic Custom controls (.VBX files), please see the following article in the Microsoft Knowledge Base: 75612
(http://support.microsoft.com/kb/75612/EN-US/
)
: How to Use CodeView for Windows (CVW.EXE) with Visual Basic
WARNING: Using Windbg as described in this article is not supported by Microsoft, so you should save all source files before using this procedure. Windbg should exit without hanging the system. However, you should not modify your Visual Basic source while running under Windbg unless you always make sure you have saved any changes before running the code. This procedure has been tested on Windows NT version 3.5. Preliminary testing on Windows NT version 3.51 shows problems when switching to Visual Basic while running under Windbg, so you should not use this procedure with Windows NT version 3.51. MORE INFORMATION
This article follows the steps and contains much of the material in 75612
(http://support.microsoft.com/kb/75612/EN-US/
)
,
but it has been modified to describe how to use the Windbg debugger to
debug a dynamic link library (.DLL file) or custom control (.VBX file)
called from Visual Basic running under Windows NT.
Windbg is one of the debuggers supplied with the Win32 SDK. It is a Windows debugger but retains many of the commands of the NTSD debugger that is also supplied with the Win32 SDK. More information may be found for both Windbg and NTSD in the Win32 Tools Users Guide. 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. Information on installing Windbg can be found in the Help files supplied with the Win32 SDK. There are several supporting .DLL files that are required to use Windbg, so it is not sufficient to copy just the WINDBG.EXE file from the SDK. How to Invoke WindbgMake sure your system is backed up and can be recovered if it should hang. This is highly unlikely because Windows NT has been designed to prevent this kind of problem.You can invoke Windbg from the Windows Program Manager in any of the following ways:
Step-by-Step ExampleThis example demonstrates how to invoke CIRC3.VBX, which comes with the Microsoft Visual Basic Control Development Kit (CDK) or the Visual Basic professional edition:
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. Tools User Guide shipped with the Win32 SDK. | Article Translations
|
Back to the top
