Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)
int AddVirtualProject ( [InAttribute] IVsHierarchy pHierarchy, [InAttribute] uint grfAddVPFlags )
int AddVirtualProject ( /** @attribute InAttribute() */ IVsHierarchy pHierarchy, /** @attribute InAttribute() */ UInt32 grfAddVPFlags )
[in] Pointer to theinterface for the virtual project object. This object must support at least the following interfaces: IVsHierarchy
[in] Determines whether to add a new virtual project to the Solution Explorer. For a list of grfAddVPFlags, see .
Return ValueIf the method succeeds, it returns . If it fails, it returns an error code.
HRESULT IVsSolution::AddVirtualProject( [in] IVsHierarchy *pHierarchy, [in] VSADDVPFLAGS grfAddVPFlags );
Virtual projects are created by another facility that manages the project, and then they are added to the solution. This method makes it possible for these project hierarchies to participate in theproject enumeration. You must include flag in the call to GetProjectEnum if virtual projects are to be included in the enumeration. If is specified, virtual projects are not included.
A virtual project is an IVsHierarchy interface item that behaves as a project in that it is a container of items (documents), but it is not a real project because it is not created by clicking Project on the New menu. Examples of virtual projects are the DataView hierarchies. These hierarchies are containers for stored procedures, tables, views, schema diagrams, and so on. By adding a DataView hierarchy as a virtual project, themethod can open items from DataView hierarchies. This functionality is important, as it makes possible the debugging of stored procedures.
Use themethod to close a virtual project.