Process2.Attach2 Yöntem
Benzer şekilde Attach, yalnızca bir altyapı veya alt yapıları kümesi belirtmenize olanak sağlar Bu işlem eklemek hata ayıklayıcı neden olur.
Ad alanı: EnvDTE80
Derleme: EnvDTE80 (EnvDTE80.dll içinde)
Sözdizimi
'Bildirim
Sub Attach2 ( _
Engines As Object _
)
void Attach2(
Object Engines
)
void Attach2(
[InAttribute] Object^ Engines
)
abstract Attach2 :
Engines:Object -> unit
function Attach2(
Engines : Object
)
Parametreler
- Engines
Tür: System.Object
A Engines koleksiyonu.
Notlar
Attach2Belirli hata ayıklama alt yapısı veya alt yapıları kümesi kullanarak bir işleme izin verir.Engines Parametresi, bir tek bstr, BSTRs, tek bir topluluğu olabilir Engine nesne veya topluluğu Engine nesneler.bstr belirtilmişse, ilk birkaç karakter adı veya onun kimliği (GUID) altyapısı sağlanabilir.Motorları listesi için belirli bir verilen Transport.
Örnekler
' Macro code.
' The examples below illustrate how to attach to default, local, and
' remote processes.
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Imports Microsoft.VisualBasic.ControlChars
Public Module Module1
Sub NativeAttachToLocalCalc()
Dim dbg2 As EnvDTE80.Debugger2
dbg2 = DTE.Debugger
Dim attached As Boolean = False
Dim proc As EnvDTE80.Process2
For Each proc In DTE.Debugger.LocalProcesses
If (Right(proc.Name, 8) = "calc.exe") Then
proc.Attach2("native")
attached = True
Exit For
End If
Next
If attached = False Then
If attached = False Then
MsgBox("calc.exe isn't running")
End If
End If
End Sub
Sub DefaultAttachToLocalCalc()
Dim dbg2 As EnvDTE80.Debugger2
dbg2 = DTE.Debugger
Dim attached As Boolean = False
Dim proc As EnvDTE80.Process2
For Each proc In DTE.Debugger.LocalProcesses
If (Right(proc.Name, 8) = "calc.exe") Then
proc.Attach2()
attached = True
Exit For
End If
Next
If attached = False Then
If attached = False Then
MsgBox("calc.exe isn't running")
End If
End If
End Sub
End Module
.NET Framework Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. Kısmen güvenilen kod kitaplıklarını kullanma.
Ayrıca bkz.
Başvuru
Diğer Kaynaklar
Nasıl yapılır: derlemek ve Otomasyon nesne modeli kod örneklerini çalıştırmak