다음을 통해 공유


IVsSolution.GetItemOfProjref Method

Definition

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

public:
 int GetItemOfProjref(System::String ^ pszProjref, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ % ppHierarchy, [Runtime::InteropServices::Out] System::UInt32 % pitemid, [Runtime::InteropServices::Out] System::String ^ % pbstrUpdatedProjref, cli::array <Microsoft::VisualStudio::Shell::Interop::VSUPDATEPROJREFREASON> ^ puprUpdateReason);
int GetItemOfProjref(std::wstring const & pszProjref, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsHierarchy const & & ppHierarchy, [Runtime::InteropServices::Out] unsigned int & pitemid, [Runtime::InteropServices::Out] std::wstring const & & pbstrUpdatedProjref, std::Array <Microsoft::VisualStudio::Shell::Interop::VSUPDATEPROJREFREASON> const & puprUpdateReason);
public int GetItemOfProjref (string pszProjref, out Microsoft.VisualStudio.Shell.Interop.IVsHierarchy ppHierarchy, out uint pitemid, out string pbstrUpdatedProjref, Microsoft.VisualStudio.Shell.Interop.VSUPDATEPROJREFREASON[] puprUpdateReason);
abstract member GetItemOfProjref : string * IVsHierarchy * uint32 * string * Microsoft.VisualStudio.Shell.Interop.VSUPDATEPROJREFREASON[] -> int
Public Function GetItemOfProjref (pszProjref As String, ByRef ppHierarchy As IVsHierarchy, ByRef pitemid As UInteger, ByRef pbstrUpdatedProjref As String, puprUpdateReason As VSUPDATEPROJREFREASON()) As Integer

Parameters

pszProjref
String

[in] Pointer to the existing project item reference string, if applicable. Can be null.

ppHierarchy
IVsHierarchy

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

pitemid
UInt32

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

pbstrUpdatedProjref
String

[out] Pointer to the updated project reference string.

puprUpdateReason
VSUPDATEPROJREFREASON[]

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

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

Applies to