This documentation is archived and is not being maintained.

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
interface VCCodeVariable : IDispatch
public interface VCCodeVariable : IDispatch
[JScript .NET]
public interface VCCodeVariable extends IDispatch


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.


Namespace: Microsoft.VisualStudio.VCCodeModel

File: vcpkg.dll


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
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