Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to detect when the Visual Studio Debugger detects a breakpoint

$
0
0

Hi, 

We are using the Microsoft Application Verifier tool on our application while it is running an automated test of the user interface. When the Application Verifier detects a problem, Visual Studio 2005 will have a breakpoint triggered. We are running an automated test of the user interface that uses the mouse and keyboard on the same machine as the debugger, which means the debugger window gets focus and could inadvertently receive the automated test's user interface commands (such as selecting the "Continue" button on the breakpoint message box).

It would be nice to be able to detect when a breakpoint like that occurs so that we can signal our automated test to stop running. I found EnvDTE.DebuggerEventsClass online (http://msdn.microsoft.com/en-us/library/envdte.debuggereventsclass.onenterbreakmode(v=vs.80).aspx) and tried to use AddHandler within the Visual Studio Macros to catch when the debugger enters the break mode, however when I try to use it, I get a "Class Not Registered" error. Further digging found that the class/events are listed as "Microsoft Internal Use Only" (see: http://msdn.microsoft.com/en-us/library/envdte.debuggereventsclass.debuggereventsclass(v=vs.80).aspx).  Is there a public interface available that does this same functionality?

I'm looking for something that does the same as the following:

Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics

Public Module DebuggerWatcher

    Public Sub StartWatching()

        Dim instance As New EnvDTE.DebuggerEventsClass
        AddHandler instance.OnEnterBreakMode, AddressOf BreakHandler

    End Sub

    Private Sub BreakHandler(ByVal Reason As EnvDTE.dbgEventReason, ByRef ExecutionAction As EnvDTE.dbgExecutionAction)
        MsgBox("BreakHander!!!")
    End Sub
End Module

Any help would be greatly appreciated.

Thanks, Tim



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>