Home Page (Objects) | Overview | FAQ | Reference
The Breakpoints object represents all the breakpoints set during a Developer Studio debugging session.
The Breakpoints object has the following properties and methods:
Properties | |
Application | _NewEnum |
Count | Parent |
Methods | |
AddBreakpointAtLine | RemoveBreakpointAtLine |
Item |
The Breakpoints object is a collection object that contains all Breakpoint objects. To find a particular object, iterate through the collection by using For Each ... Next in a VBScript macro.
Consider the following code snippet:
Dim myBreakpoint
For Each myBreakpoint in Debugger.Breakpoints
' Access myBreakpoint here.
' For example:
MsgBox myBreakpoint.PassCount
Next
In Visual C++, you can iterate through the Breakpoints collection by using the Item method or _NewEnum property.
When you reference the Breakpoints collection, the reference always reflects the current contents of the collection. For example, suppose you have two macros (A and B). In macro A, you set a global variable to the collection, and in macro B you use the variable. When you use it, the variable will reflect the current contents of the collection — not the contents present when you set the variable.
Using a Dual Interface to Access This Object
This section about dual interfaces is useful for writing add-ins or automating Developer Studio across processes. This section is not applicable to writing VBScript macros.
The Breakpoints object implements the IBreakpoints dual interface. Through this interface, add-ins can directly access the members (properties, methods, and events) of this object and can employ early binding to make calls into these members faster at run time.
Add-ins written in Visual C++ can access members of the Breakpoints object by using the header files in Vc98\Include\objmodel. However, if you use the Developer Studio Add-in Wizard to create an add-in, the wizard automatically includes these header files in your source code.
The following table shows the header files you need for the Breakpoints object:
Header file | Description |
dbgauto.h | Declares the dual interfaces. |
dbgguid.h | Declares the GUIDs used to identify the interfaces. |
dbgdefs.h | Declares additional information needed to use the interfaces, such as error IDs and enumerated constants. |
Add-ins written in Visual Basic can access members of the Breakpoints object by using the Debugger type library, located in msdev98\bin\ide\devdbg.pkg.
Note In the Visual Basic References dialog box (Project menu, References command), the names of the type libraries begin with "Visual C++ 6.0" for Visual C++ version 6.0. For Visual C++ version 5.0, the names begin with "Visual Studio '97."