Export (0) Print
Expand All

Samples for Code Model Extensibility

Most reference topics in the Visual C++ Code Model Extensibility reference contain a code sample. This code sample has been tested to compile using the Macro environment and run in the Visual Studio development environment while a C++ project is active.

To compile and run a code sample with the macro editor

  1. Select Other Windows from the View menu and then select Macro Explorer.
  2. Open the MyMacros node.
  3. Right-click Module1 and select Edit from the context menu.

    This opens the Visual Studios Macros environment.

  4. Right-click the references folder and select Add Reference from the context menu.
  5. In the Add Reference dialog box, select the Microsoft.VisualStudio.VCCodeModel DLL.
  6. Insert the following code at the top of the module file:
    Imports Microsoft.VisualStudio.VCCodeModel
    
  7. Add the sample code from the reference topic to the module file.
  8. Right-click MyMacros and select Build from the context menu.
  9. Close the Visual Studios Macros environment.
  10. From Macro Explorer, right-click the procedure name (from Module1) and select Run from the context menu.

See Also

Visual C++ Extensibility Object Model

Show:
© 2014 Microsoft