Share via


VCActiveXReference.ControlGUID 속성

선택한 ActiveX 참조의 GUID를 가져옵니다.

네임스페이스:  Microsoft.VisualStudio.VCProjectEngine
어셈블리:  Microsoft.VisualStudio.VCProjectEngine(Microsoft.VisualStudio.VCProjectEngine.dll)

구문

‘선언
ReadOnly Property ControlGUID As String
string ControlGUID { get; }
property String^ ControlGUID {
    String^ get ();
}
abstract ControlGUID : string with get
function get ControlGUID () : String

속성 값

형식: System.String
선택한 ActiveX 참조의 GUID 값입니다.

설명

이 샘플을 컴파일하고 실행하는 방법을 보려면 방법: Visual C++ 코드 모델 확장성에 대한 예제 코드 컴파일을 참조하십시오.

예제

솔루션의 각 프로젝트를 반복 하 고 각 ActiveX (COM) 컨트롤의 GUID를 나열 합니다.

' Add a reference to Microsoft.VisualStudio.VCProjectEngine and have a 
' Visual C++ project loaded before running this example. Also, you 
' should have at least one ActiveX (COM) reference in a project.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim proj As Project
        Dim vcproj As VCProject
        Dim ref As VCReference
        Dim axref As VCActiveXReference
     
        On Error Resume Next

        ' Loop each project in the solution.
        For Each proj In DTE.Solution.Projects
            vcproj = Nothing
            vcproj = CType(proj.Object, VCProject)
            ' If this project is a Visual C++ project
            If Not vcproj Is Nothing Then
                ' Loop the references for this Visual C++ project
                For Each ref In vcproj.VCReferences
                    axref = Nothing
                    axref = CType(ref, VCActiveXReference)
                    ' If this reference is an ActiveX reference
                    If Not axref Is Nothing Then
                        MsgBox("Control GUID: " & axref.ControlGUID)
                    End If
                Next
            End If
        Next
    End Sub
End Module

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

VCActiveXReference 인터페이스

Microsoft.VisualStudio.VCProjectEngine 네임스페이스