VCCodeVariable Interface
An object representing a variable construct in a source file.
Namespace: Microsoft.VisualStudio.VCCodeModel
Assembly: Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)
Syntax
'إقرار
<GuidAttribute("B8C3E2D9-B807-4CCB-96E0-8B1C4E00D34A")> _
Public Interface VCCodeVariable
'الاستخدام
Dim instance As VCCodeVariable
[GuidAttribute("B8C3E2D9-B807-4CCB-96E0-8B1C4E00D34A")]
public interface VCCodeVariable
[GuidAttribute(L"B8C3E2D9-B807-4CCB-96E0-8B1C4E00D34A")]
public interface class VCCodeVariable
[<GuidAttribute("B8C3E2D9-B807-4CCB-96E0-8B1C4E00D34A")>]
type VCCodeVariable = interface end
public interface VCCodeVariable
Remarks
The VCCodeVariable object is used to modify an existing variable construct.
ملاحظة
A large part of the functionality of this object is provided by the Visual Studio CodeVariable object. For more information, see CodeVariable object.
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 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