Chapter 3 -- Debugging Applications

Chapter 3

Debugging Applications

Overview

Microsoft Visual Studio 6 includes a built-in debugger with its own complete set of windows and its own toolbar. The debugger allows you to debug both Microsoft Visual InterDev and Visual J++ applications and components. You can also use the debugger to step into the code of components used in Visual InterDev applications written in Microsoft Visual Basic and Visual C++, as long as you have the source code for the application or component.

This chapter will demonstrate how to use the debugger to debug Active Server Pages (ASP) script, client-side script, and Visual Basic components. You'll see how you can use this tool both locally on a system and against an application running remotely on a server. Figure 3-1 below shows the debugger interface.

The Visual InterDev debugging process is similar to debugging a Visual Basic application. You can:

  • Set breakpoints in your application
  • Step into the application code
  • Display the contents of variables
  • Change the values of variables
  • Execute commands in the Immediate window
  • Make corrections to the code

click to view at full size.

Figure 3-1. The debugger in Source view.

Table 3-1 describes some of the windows that are available for use in the debugger for Visual InterDev applications. The control sequence to activate the window is shown in parentheses after the window's name.

NOTE
To debug client-side script in Microsoft Internet Explorer, you must be using Internet Explorer 4 and you must have enabled the Visual InterDev debugger.

Table 3-1. Useful Visual InterDev Windows for debugging.

Window Name Description
Immediate (Ctrl+Alt+I) Used to display information about the appli-cation's state and to interact with the application by executing commands and setting variables.
Watch (Ctrl+Alt+W) Used to display watch expressions, which generally show the value of variables in the application, to change the values of variables, and to display the contents of object properties.
Locals (Ctrl+Alt+L) Used to display the value of variables that are within the scope of the current procedure. Variables are displayed as long as they have a value. You can use the Locals window to determine when a variable is initialized and when it is destroyed.

You can debug server script in any of these ways:

  • Run a page containing the script to debug from within a Visual InterDev solution.
  • Attach the Visual InterDev debugger to a process (page) already running in Internet Explorer.
  • Respond to a syntax or run-time error in a script; this is called just-in-time debugging.
  • Include a statement in script that starts the debugger.

Some of these methods will be discussed later in this chapter. There is also more information on debugging in the Visual InterDev documentation and on the Microsoft Visual Studio Web site (http://msdn.microsoft.com/vstudio).



Programming Microsoft Visual InterDev 6. 0
Programming Microsoft Visual InterDev 6.0
ISBN: 1572318147
EAN: 2147483647
Year: 2005
Pages: 143

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net