This documentation is archived and is not being maintained.

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 Microsoft.VisualStudio.Shell.Interop.dll)

int GetItemOfProjref(
	string pszProjref,
	out IVsHierarchy ppHierarchy,
	out uint pitemid,
	out string pbstrUpdatedProjref,
	VSUPDATEPROJREFREASON[] puprUpdateReason
)

Parameters

pszProjref
Type: System.String
[in] Pointer to the existing project item reference string, if applicable. Can be null.
ppHierarchy
Type: Microsoft.VisualStudio.Shell.Interop.IVsHierarchy
[out] Pointer to the IVsHierarchy interface referred to by the project reference.
pitemid
Type: System.UInt32
[out] Pointer to the item identifier referred to by the project reference. For a list of enumerated pitemid values, see VSITEMID.
pbstrUpdatedProjref
Type: System.String
[out] Pointer to the updated project reference string.
puprUpdateReason
Type: Microsoft.VisualStudio.Shell.Interop.VSUPDATEPROJREFREASON[]
[out] Identifier describing the reason for a change in the project reference string. For a list of puprUpdateReason values, see VSUPDATEPROJREFREASON.

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::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.

Show: