Partager via


IVsSolution.AddVirtualProjectEx(IVsHierarchy, UInt32, Guid) Method

Definition

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

public:
 int AddVirtualProjectEx(Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ pHierarchy, System::UInt32 grfAddVPFlags, Guid % rguidProjectID);
public int AddVirtualProjectEx (Microsoft.VisualStudio.Shell.Interop.IVsHierarchy pHierarchy, uint grfAddVPFlags, ref Guid rguidProjectID);
abstract member AddVirtualProjectEx : Microsoft.VisualStudio.Shell.Interop.IVsHierarchy * uint32 * Guid -> int
Public Function AddVirtualProjectEx (pHierarchy As IVsHierarchy, grfAddVPFlags As UInteger, ByRef rguidProjectID As Guid) As Integer

Parameters

pHierarchy
IVsHierarchy

[in] Pointer to a hierarchy object.

grfAddVPFlags
UInt32

[in] Determines whether to add a new virtual project to the Solution Explorer. For a list of grfAddVPFlags, see __VSADDVPFLAGS.

rguidProjectID
Guid

[in] Unique project identifier (GUID).

Returns

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.

Note

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

Applies to