Compartir a través de


VCCodeUnion Interface

An object representing a union code element in the source code of a solution.

Namespace:  Microsoft.VisualStudio.VCCodeModel
Assembly:  Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)

Syntax

<GuidAttribute("17730D51-271F-11D7-8BF6-00B0D03DAA06")> _
Public Interface VCCodeUnion

Dim instance As VCCodeUnion
[GuidAttribute("17730D51-271F-11D7-8BF6-00B0D03DAA06")]
public interface VCCodeUnion
[GuidAttribute(L"17730D51-271F-11D7-8BF6-00B0D03DAA06")]
public interface class VCCodeUnion
public interface VCCodeUnion

Remarks

The VCCodeUnion object is used to modify an existing union construct.

See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.

Examples

This example displays the name of each union code element in the current solution. It assumes a C++ project is open and that it has global unions.

Sub GetAllUnions()
    Dim vcCM As VCCodeModel
    Dim vcUnion As VCCodeUnions
    vcCM = DTE.Solution.Item(1).CodeModel
    For Each vcUnion in vcCM.Unions
        MsgBox(vcUnion.DisplayName)
    Next
End Sub

See Also

Reference

VCCodeUnion Members

Microsoft.VisualStudio.VCCodeModel Namespace