Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Engine Interface 

A debug engine that is used to map to code type.

Namespace: EnvDTE80
Assembly: EnvDTE80 (in envdte80.dll)

[GuidAttribute("8CEA6D39-EBEE-4DE9-B282-B5CECE9C9861")] 
public interface Engine
/** @attribute GuidAttribute("8CEA6D39-EBEE-4DE9-B282-B5CECE9C9861") */ 
public interface Engine
GuidAttribute("8CEA6D39-EBEE-4DE9-B282-B5CECE9C9861") 
public interface Engine

Used to determine how the debugger will debug based on the code. This corresponds to the Attach to Process window.

An Engine object is used to specify what type of programs are intended to be debugged in a given process. For example, if you want to debug only managed code inside a process, attach to the process using the "Common Language Runtime" debugging engine. If you want to debug both managed and unmanaged parts of a process, attach with the "Interop COM+" engine.

NoteNote

When you record a macro and attach to a debugging process using the T-SQL debugging engine, the macro returns two separate references to the same engine name. For example, dbgeng(0) = transprt.Engines.Item("T-SQL") and dbgeng(1) = transprt.Engines.Item("T-SQL"). This happens because there are actually two underlying T-SQL debugging engines in Visual Studio: one for the SQL Server 2005 debugging engine, the other for the T-SQL debugging engine for SQL Server 2000 and SQL Server 7. They are both automatically referenced when attaching to a debugging engine process via the UI, but in automation code, they must each be referenced by using their unique identifier GUID. The GUID for SQL Server 2005 is {1202F5B4-3522-4149-BAD8-58B2079D704F}, and the GUID for the T-SQL debugging engine for SQL Server 2000 and SQL Server 7 is {5AF6F83C-B555-11D1-8418-00C04FA302A1}. So the above calls should be changed to dbgeng(0) = trans.Engines.Item("{1202F5B4-3522-4149-BAD8-58B2079D704F}") and dbgeng(1) = trans.Engines.Item("{1202F5B4-3522-4149-BAD8-58B2079D704F}") respectively.

' Macro code.
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Imports Microsoft.VisualBasic.ControlChars

Public Module Module1

    Sub ShowDefaultEngines()
        Dim dbg As EnvDTE80.Debugger2
        dbg = DTE.Debugger

        dbg.HexDisplayMode = True

        Dim transport As EnvDTE80.Transport
        transport = dbg.Transports.Item("default")

        Dim engine As EnvDTE80.Engine
        Dim strEngineList As String
        For Each engine In transport.Engines
            strEngineList = strEngineList + engine.Name + ", " + _
            engine.ID + ", " + engine.AttachResult.ToString + NewLine
        Next
        MsgBox(strEngineList)
    End Sub
End Module
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.