Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

VCCodeMacro Object

Visual Studio .NET 2003

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

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

Remarks

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

Requirements

Namespace: Microsoft.VisualStudio.VCCodeModel

File: vcpkg.dll

Example

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 Samples for Code Model Extensibility for information on how to compile and run this sample.

See Also

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.