Debugger3.CurrentProgram Özellik

Tanım

Etkin programı ayarlar veya döndürür.

public:
 property EnvDTE::Program ^ CurrentProgram { EnvDTE::Program ^ get(); void set(EnvDTE::Program ^ value); };
public:
 property EnvDTE::Program ^ CurrentProgram { EnvDTE::Program ^ get(); void set(EnvDTE::Program ^ value); };
[System.Runtime.InteropServices.DispId(104)]
public EnvDTE.Program CurrentProgram { [System.Runtime.InteropServices.DispId(104)] get; [System.Runtime.InteropServices.DispId(104)] set; }
[<System.Runtime.InteropServices.DispId(104)>]
[<get: System.Runtime.InteropServices.DispId(104)>]
[<set: System.Runtime.InteropServices.DispId(104)>]
member this.CurrentProgram : EnvDTE.Program with get, set
Public Property CurrentProgram As Program

Özellik Değeri

Program

Bir Program nesnesi.

Uygulamalar

Öznitelikler

Örnekler

Sub DumpStacks()  
    ' This macro dumps the stack for each thread   
    ' running in the current program to the   
    ' Command window.  The output format is identical   
    ' to that of the call-stack window except the current  
    ' line is not printed.  
    Dim d As EnvDTE90.Debugger3  
    d = dte.Debugger3  
    Dim ow As CommandWindow  
    ow = dte.Windows.Item(Constants.vsWindowKindCommandWindow).Object  

    If d.CurrentProgram Is Nothing Then  
        ow.OutputString("No program is currently being debugged." + _  
        vbCrLf)  
    Else  
        Dim MyThread As Thread  
        ow.OutputString("Current Program: " + d.CurrentProgram.Name + _  
        vbCrLf)  

        For Each MyThread In d.CurrentProgram.Threads  
            ow.OutputString("" + vbTab + "Thread _  
            (" + Str(MyThread.ID) + " ) " + MyThread.Name + vbCrLf)  

            Dim MyFrame As EnvDTE.StackFrame  
            For Each MyFrame In MyThread.StackFrames  
                Dim strModule As String  
                Dim pos As Integer = InStrRev(MyFrame.Module, "\")  
                If pos > 0 Then  
                    strModule = Right(MyFrame.Module, _  
                    Len(MyFrame.Module) - pos)  
                Else  
                    strModule = MyFrame.Module  
                End If  

                Dim strFName As String = MyFrame.FunctionName  
                'Create the argument list.  
                Dim strArgs As String  
                Dim MyArg As Expression  
                Dim i = 0  
                For Each MyArg In MyFrame.Arguments  
                    If i > 0 Then  
                        strArgs = strArgs + ", "  
                    End If  
                    strArgs = strArgs + MyArg.Type + " " + _  
                    MyArg.Name + "=" + MyArg.Value  
                    i = i + 1  
                Next  
                'Output the frame information.  
                ow.OutputString("" + vbTab + vbTab + strModule + ": _  
                " + strFName + "(" + strArgs + ")" + vbCrLf)  
            Next  
        Next  
    End If  
End Sub  

Açıklamalar

Etkin program, hata ayıklayıcı tarafından görüntülenen verileri tanımlayan programdır. Hata ayıklayıcı aynı anda birden fazla işlemden hata ayıklamayı desteklese de, belirli bir zamanda yalnızca bir işlem etkin olabilir. Daha fazla bilgi için bkz. birden çok programda hata ayıklama.

Şunlara uygulanır