IVsSolution.GetProjrefOfProject Method

Returns a project reference string for the specified hierarchy.

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


Function GetProjrefOfProject ( _
    pHierarchy As IVsHierarchy, _
    <OutAttribute> ByRef pbstrProjref As String _
) As Integer
‘사용 방법
Dim instance As IVsSolution
Dim pHierarchy As IVsHierarchy
Dim pbstrProjref As String
Dim returnValue As Integer

returnValue = instance.GetProjrefOfProject(pHierarchy, _
int GetProjrefOfProject(
    IVsHierarchy pHierarchy,
    out string pbstrProjref
int GetProjrefOfProject(
    [InAttribute] IVsHierarchy^ pHierarchy, 
    [OutAttribute] String^% pbstrProjref
abstract GetProjrefOfProject : 
        pHierarchy:IVsHierarchy * 
        pbstrProjref:string byref -> int 
function GetProjrefOfProject(
    pHierarchy : IVsHierarchy, 
    pbstrProjref : String
) : int


  • pbstrProjref
    Type: System.String%
    [out] Pointer to the project reference string.

Return Value

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


COM Signature

From vsshell.idl:

HRESULT IVsSolution::GetProjrefOfProject(
   [in] IVsHierarchy *pHierarchy,
   [out] BSTR *pbstrProjref

The following is a description of how the GetProjrefOfProject method is used to support drag-and-drop operations:

The CF_VSPROJECTITEMS and CF_VSPROJECTS clipboard formats use the DROPFILES structure in the same manner as CF_HDROP or CF_PRINTERS. The data that follows the DROPFILES structure is a double-NULL-terminated list of Projref strings. The consumer of the drop operation can use the Windows API DragQueryFile to examine the data in the DROPFILES structure. CF_VSPROJECTS format is offered when the Projref strings identify projects as a whole, that is, *pitemid == VSITEMID_ROOT. The CF_VSPROJECTITEMS format is offered when the Projref strings identify one or more individual project items. Either CF_VSPROJECTS or CF_VSPROJECTITEMS should be offered, but never both.

.NET Framework Security

See Also


IVsSolution Interface

IVsSolution Members

Microsoft.VisualStudio.Shell.Interop Namespace