次の方法で共有


IVsUIHierWinClipboardHelper.Paste(IDataObject, UInt32) Method

Definition

Pastes a data object from the clipboard to the hierarchy.

public:
 int Paste(Microsoft::VisualStudio::OLE::Interop::IDataObject ^ pDataObject, System::UInt32 dwEffects);
public:
 int Paste(Microsoft::VisualStudio::OLE::Interop::IDataObject ^ pDataObject, unsigned int dwEffects);
int Paste(Microsoft::VisualStudio::OLE::Interop::IDataObject const & pDataObject, unsigned int dwEffects);
public int Paste (Microsoft.VisualStudio.OLE.Interop.IDataObject pDataObject, uint dwEffects);
abstract member Paste : Microsoft.VisualStudio.OLE.Interop.IDataObject * uint32 -> int
Public Function Paste (pDataObject As IDataObject, dwEffects As UInteger) As Integer

Parameters

pDataObject
IDataObject

[in] Pointer to the IDataObject interface on the item being pasted. This data object contains the data being transferred in the paste operation. If the paste occurs, then this data object (hierarchy item) is incorporated into the target hierarchy.

dwEffects
UInt32

[in] Pointer to the value of the pdwEffect parameter of the IVsHierarchy object, identifying all effects that the hierarchy supports.

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsUIHierWinClipboardHelper::Paste(  
   [in] IDataObject *pDataObject,  
   [in] DWORD dwEffects  
);  

When a paste occurs on the target hierarchy, the source hierarchy receives paste notification from the environment through the OnPaste method.

Drop effects are included in the dwEffect parameter and describe the action associated with a drop operation. The following table shows possible dwEffect values and their descriptions:

Note

These effects are exclusive and cannot be combined using the bitwise OR operator.

EFFECT name Value1 Description
DROPEFFECT_NONE 0 Drop target (hierarchy window) cannot accept the data. No drop would be allowed.
DROPEFFECT_COPY 1 Dropped item remains in the source and a copy of it is added to the target.
DROPEFFECT_MOVE 2 Dropped item was added to the target. The item is removed from the source and its storage is deleted.
DROPEFFECT_LINK 4 A link to the source item is added to the target so the item should be removed from the source but the storage should remain so that the link is not broken. A link is therefore a special case of move.
  1. The values of the dwEffects parameter are taken from the DROPEFFECT enumeration in the MSDN Library Platform SDK documentation set.

Applies to