Basic Project Sample
The Basic Project sample contributes a simple reference-based project to the environment.
The Basic Project sample:
-
Is fundamental in nature.
-
Demonstrates a simple type of project without registered file extensions.
-
Shows an implementation of the IVsHierarchy interface and other related interfaces.
Security Note |
|---|
| This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended. |
This sample depends on the implementation helper HierUtl. You could use the Basic Project sample as your starting point for your own project, provided you create new globally unique identifiers (GUIDs) where necessary.
The project type created by Basic Project is similar to the Utility Project that is a feature of Visual Studio. The main purpose of Basic Project is to present a sound example of all the recommended project features.
Note |
|---|
| The default path for the Basic Project sample is <drive>:\Program Files\Visual Studio 2005 SDK\<build number>\VisualStudioIntegration\Unsupported\BscPrj\BscPrj. |
To build this sample
-
Start Visual Studio 2005. Type devenv.exe at the command line.
-
Open the BscPrj.sln file within Visual Studio.
-
On the Build menu, choose Rebuild Solution.
-
Run the following command to merge command bars and other UI items.
devenv.exe /setup /rootsuffix exp
To run this sample
-
Start Visual Studio 2005 using the experimental build by typing the following at the command line.
devenv.exe /rootsuffix exp
-
On the File menu, select New, and then click Project.
-
Expand the Other Projects node in the New Project dialog box.
-
Choose BscPrj Projects and then click OK.
Once you have built the sample, you can:
-
Add new project items (in this case, files) supporting all Add Item dialog boxes.
-
Open and persist project items.
-
Cut, copy, and paste items into the project hierarchy.
-
Move items to the project using a drag-and-drop operation.
-
Use the Context menu.
-
View project items in the Properties window.
-
Consume the automation model of the Basic Project, writing macros or add-ins against the project items as well as against the build, run, and deploy configuration options.
-
Persist state information for Visual Studio.
-
Work seamlessly with other projects through the solution.
-
Use new, simpler file saving techniques in Basic Project.
Note Basic Project does not provide its own project files with unique file extensions. Instead, new items can include .htm and .cppjava files. In addition, Basic Project does not support a project-specific editor. Instead, it opens items in accord with the appropriate standard editor for a file type.
The following table lists the interfaces implemented by the Basic Project sample.
| Implemented Interfaces |
|---|
| IDispatch |
| IVsHierarchy |
The following table lists the interfaces called by the Basic Project sample and their associated services.
| Called Interfaces | Associated Service |
|---|---|
| IOleCommandTarget | |
| IVsExtensibility | SVsExtensibility |
The following table lists the important files used when implementing Basic Project.
| File name | Description |
|---|---|
| VsModule.cpp | CComModule-derived object that implements some environment related helpers |
| DllEntry.cpp | Standard implementation of .dll exports |
| VsPkg.cpp | Standard implementation of IVsPackage in CVsPackage |
| VsPkg.rgs | Registers the VSPackage and its command bar. |
| BscExt.idl | Defines BscPrj project extensibility interfaces. |
| CfgProvider.cpp/.h | Implements IVsCfgProvider2. |
Security Note