Freigeben über


IVsSolution.AddVirtualProjectEx Method

Assigns the original GUID to the project when it is recreated the next time the solution is opened.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function AddVirtualProjectEx ( _
    pHierarchy As IVsHierarchy, _
    grfAddVPFlags As UInteger, _
    ByRef rguidProjectID As Guid _
) As Integer
'Usage
Dim instance As IVsSolution
Dim pHierarchy As IVsHierarchy
Dim grfAddVPFlags As UInteger
Dim rguidProjectID As Guid
Dim returnValue As Integer

returnValue = instance.AddVirtualProjectEx(pHierarchy, _
    grfAddVPFlags, rguidProjectID)
int AddVirtualProjectEx(
    IVsHierarchy pHierarchy,
    uint grfAddVPFlags,
    ref Guid rguidProjectID
)
int AddVirtualProjectEx(
    [InAttribute] IVsHierarchy^ pHierarchy, 
    [InAttribute] unsigned int grfAddVPFlags, 
    [InAttribute] Guid% rguidProjectID
)
abstract AddVirtualProjectEx : 
        pHierarchy:IVsHierarchy * 
        grfAddVPFlags:uint32 * 
        rguidProjectID:Guid byref -> int 
function AddVirtualProjectEx(
    pHierarchy : IVsHierarchy, 
    grfAddVPFlags : uint, 
    rguidProjectID : Guid
) : int

Parameters

  • grfAddVPFlags
    Type: System.UInt32
    [in] Determines whether to add a new virtual project to the Solution Explorer. For a list of grfAddVPFlags, see __VSADDVPFLAGS.
  • rguidProjectID
    Type: System.Guid%
    [in] Unique project identifier (GUID).

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsSolution::AddVirtualProjectEx(
   [in] IVsHierarchy *pHierarchy,
   [in] VSADDVPFLAGS grfAddVPFlags,
   [in] REFGUID rguidProjectID
);

This method is the same as AddVirtualProject except that the caller can specify a per-instance GUID project identifier (rGUIDProjectID) for this project to enable GetProjectOfGuid and GetProjectOfProjref to function properly. The caller is responsible for persisting this instance GUID and passing the same GUID when reloading the same project instance.

Hinweis

The GUID project identifier is not the same as the GUID project type. CoCreateGuid() is useful for creating new GUIDs.

.NET Framework Security

See Also

Reference

IVsSolution Interface

IVsSolution Members

Microsoft.VisualStudio.Shell.Interop Namespace