GetItemOfProjref Method
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

IVsSolution.GetItemOfProjref Method

Returns a hierarchy and hierarchy item pair for the specified project reference string.

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

int GetItemOfProjref (
	[InAttribute] string pszProjref,
	out IVsHierarchy ppHierarchy,
	out uint pitemid,
	out string pbstrUpdatedProjref,
	[OutAttribute] VSUPDATEPROJREFREASON[] puprUpdateReason
int GetItemOfProjref (
	/** @attribute InAttribute() */ String pszProjref, 
	/** @attribute OutAttribute() */ /** @ref */ IVsHierarchy ppHierarchy, 
	/** @attribute OutAttribute() */ /** @ref */ UInt32 pitemid, 
	/** @attribute OutAttribute() */ /** @ref */ String pbstrUpdatedProjref, 
	/** @attribute OutAttribute() */ VSUPDATEPROJREFREASON[] puprUpdateReason
JScript does not support passing value-type arguments by reference.



[in] Pointer to the existing project item reference string, if applicable. Can be a null reference (Nothing in Visual Basic).


[out] Pointer to the IVsHierarchy interface referred to by the project reference.


[out] Pointer to the item identifier referred to by the project reference. For a list of enumerated pitemid values, see VSITEMID.


[out] Pointer to the updated project reference string.


[out] Identifier describing the reason for a change in the project reference string. For a list of puprUpdateReason values, see VSUPDATEPROJREFREASON.

Return Value

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

COM Signature

From vsshell.idl:

HRESULT IVsSolution::GetItemOfProjref(
   [in] LPCOLESTR pszProjref,
   [out] IVsHierarchy **ppHierarchy,
   [out] VSITEMID *pitemid,
   [out] BSTR *pbstrUpdatedProjref,
   [out] VSUPDATEPROJREFREASON *puprUpdateReason

During a drag-and-drop or cut-and-paste operation, the environment places a set of project references on the clipboard for the source item in the operation. This method is used by the target in these operations to change the project references from the clipboard back into hierarchy and hierarchy item pairs. The target can then notify the source that it has incorporated these items.

The following is a description of how the GetItemOfProjref 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 Microsoft® 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.

© 2016 Microsoft