Export (0) Print
Expand All

VCCodeVariable Object

Visual Studio .NET 2003

An object representing a variable construct in a source file.

[Visual Basic .NET]
Public Interface VCCodeVariable
   Inherits IDispatch
[Visual Basic 6]
Class VCCodeVariable
[C++]
interface VCCodeVariable : IDispatch
[C#]
public interface VCCodeVariable : IDispatch
[JScript .NET]
public interface VCCodeVariable extends IDispatch

Remarks

The VCCodeVariable object is used to modify an existing variable construct.

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

Requirements

Namespace: Microsoft.VisualStudio.VCCodeModel

File: vcpkg.dll

Example

This example retrieves all variables of the current solution and displays each name in a message box. It assumes a default MFC project is open.

Sub GetAllVars()
    Dim vcCM As VCCodeModel
    Dim vcVar As VCCodeVariable
    vcCM = DTE.Solution.Item(1).CodeModel
    For Each vcVar in vcCM.Variables
        MsgBox(vcVar.DisplayName)
    Next
End Sub

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

See Also

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

Show:
© 2014 Microsoft