VCCodeMacro Interface

An object representing a macro (#define statement) code element in the source code of a solution.

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

Syntax

声明
<GuidAttribute("17730D49-271F-11D7-8BF6-00B0D03DAA06")> _
Public Interface VCCodeMacro
用法
Dim instance As VCCodeMacro
[GuidAttribute("17730D49-271F-11D7-8BF6-00B0D03DAA06")]
public interface VCCodeMacro
[GuidAttribute(L"17730D49-271F-11D7-8BF6-00B0D03DAA06")]
public interface class VCCodeMacro
public interface VCCodeMacro

Remarks

The VCCodeMacroobject represents the #define code element. Primarily, the object is used to access or modify the elements of an existing macro.

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 the first VCCodeMacro object of the current solution and displays it in a message box. It assumes a default MFC project is open.

Sub GetFirstMacro()
    Dim vcCM As VCCodeModel
    Dim vcMacro As VCCodeMacro
    vcCM = DTE.Solution.Item(1).CodeModel
    vcMacro = vcCM.Macros.Item(1)
    MsgBox(vcMacro.DisplayName)
End Sub

See Also

Reference

VCCodeMacro Members

Microsoft.VisualStudio.VCCodeModel Namespace