共用方式為


IVsSolution2.GetGuidOfProject(IVsHierarchy, Guid) Method

Definition

Returns the unique identifier for a project in the solution.

public:
 int GetGuidOfProject(Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ pHierarchy, [Runtime::InteropServices::Out] Guid % pguidProjectID);
public int GetGuidOfProject (Microsoft.VisualStudio.Shell.Interop.IVsHierarchy pHierarchy, out Guid pguidProjectID);
abstract member GetGuidOfProject : Microsoft.VisualStudio.Shell.Interop.IVsHierarchy * Guid -> int
Public Function GetGuidOfProject (pHierarchy As IVsHierarchy, ByRef pguidProjectID As Guid) As Integer

Parameters

pHierarchy
IVsHierarchy

[in] Pointer to the IVsHierarchy interface of the project for which the identifier is requested.

pguidProjectID
Guid

[out] Pointer to the unique identifier of the project.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Implements

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsSolution2::GetGuidOfProject(  
   [in] IVsHierarchy *pHierarchy,   
   [out] GUID *pguidProjectID  
);  

Based on a project, this method returns the GUID for a project in a solution.

Applies to