Samples for Project Model Extensibility
Most reference topics in the Visual C++ Project Model contain a code sample. This code sample has been tested to compile using the macro environment and run in the Visual Studio integrated development environment while a C++ project is active.
You need to add the Microsoft.VisualStudio.VCProjectEngine reference to the macro environment. For more information, see Adding and Removing References.
To compile and run a code sample with the macro editor
- Select Other Windows from the View menu and then select Macro Explorer.
- Double click Module1 under the MyMacros node.
- Replace the contents of Module1 with the sample code from the reference topic.
- Right-click the MyMacros node and select Build from the shortcut menu.
- Close the Visual Studio macros environment.
- In Macro Explorer, right-click the procedure name from Module1 and select Run from the shortcut menu.
See Project Model Samples for samples of how to instantiate Project Model objects in various Visual Studio languages.