IVsSupportItemHandoff::HandoffItem Method (UInt32, IVsProject3^, String^, String^, IVsWindowFrame^)

 

Supports transferring an item from one project to another.

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

int HandoffItem(
	unsigned int itemid,
	IVsProject3^ pProjDest,
	String^ pszMkDocumentOld,
	String^ pszMkDocumentNew,
	IVsWindowFrame^ punkWindowFrame
)

Parameters

itemid
Type: System::UInt32

[in] Identifier of the item to be transferred.

pProjDest
Type: Microsoft.VisualStudio.Shell.Interop::IVsProject3^

[in] Project to which the document will be transferred.

pszMkDocumentOld
Type: System::String^

[in] String form of the moniker identifier of the document in the project system for the document prior to transfer. The requesting project will pass this value to RenameDocument in the pszDocumentOld parameter.

pszMkDocumentNew
Type: System::String^

[in] String form of the moniker identifier of the document in the project system for the document following transfer. The requesting project will pass this value to RenameDocument as the pszDocumentNew parameter.

punkWindowFrame
Type: Microsoft.VisualStudio.Shell.Interop::IVsWindowFrame^

[in] Pointer to the window frame containing the document view. This parameter is optional if the document is not open.

Return Value

Type: System::Int32

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

From vsshell.idl:

HRESULT IVsSupportItemHandoff::HandoffItem(
   [in] VSITEMID itemid,
   [in] IVsProject3 *pProjDest,
   [in] LPCOLESTR pszMkDocumentOld,
   [in] LPCOLESTR pszMkDocumentNew,
   [in] IVsWindowFrame *punkWindowFrame
);

In your IVsSupportItemHandoff.HandoffItem implementation, call TransferItem on the project requesting the item (pProjDest). In the method call, pass the values in pszMkDocumentOld, pszMkDocumentNew, and punkWindowFrame to the requesting project. The requesting project will then transfer the open document window for the item to itself and rename the document appropriately in the running document table (RDT) by calling RenameDocument.

Return to top
Show: