Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

VCCodeAttribute Object

Visual Studio .NET 2003

An object providing access to the attribute of an item.

[Visual Basic .NET]
Public Interface VCCodeAttribute
   Inherits IDispatch
[Visual Basic 6]
Class VCCodeAttribute
interface VCCodeAttribute : IDispatch
public interface VCCodeAttribute : IDispatch
[JScript .NET]
public interface VCCodeAttribute extends IDispatch


The VCCodeAttribute object represents either a CLR or COM metadata attribute associated with a code element. You can add new attributes with the AddAttribute method and get and set the value of a code attribute with the VCCodeAttribute object.

Note   A large part of the functionality of this object is provided by the Visual Studio CodeAttribute object. For more information, see CodeAttribute object.


Namespace: Microsoft.VisualStudio.VCCodeModel

File: vcpkg.dll


This example displays the names of all attributes applied to the ATLProjectLib library. It is assumed that the ATLProjectLib library exists.

    Sub GetAttributes()
        Dim vcCM As VCCodeModel
        Dim vcLibrary As VCCodeIDLLibrary
        Dim vcAttribute As VCCodeAttribute
        Dim i As Integer
        vcCM = DTE.Solution.Item(1).CodeModel
        vcLibrary = vcCM.IDLLibraries.Find("ATLProjectLib")
        For i = 1 To vcLibrary.Attributes.Count
            vcAttribute = vcLibrary.Attributes.Item(i)
    End Sub

See Samples for Code Model Extensibility for information on how to compile and run this sample.

See Also

VCCodeAttribute Object Properties, Methods, and Events | Visual C++ Extensibility Object Model

© 2015 Microsoft