다음을 통해 공유


COleDropTarget::OnDrop

Called by the framework when a drop operation is to occur.

virtual BOOL OnDrop( 
   CWnd* pWnd, 
   COleDataObject* pDataObject, 
   DROPEFFECT dropEffect, 
   CPoint point  
);

Parameters

  • pWnd
    Points to the window the cursor is currently over.

  • pDataObject
    Points to the data object that contains the data to be dropped.

  • dropEffect
    The effect that the user chose for the drop operation. It can be one or more of the following:

    • DROPEFFECT_COPY   A copy operation would be performed.

    • DROPEFFECT_MOVE   A move operation would be performed.

    • DROPEFFECT_LINK   A link from the dropped data to the original data would be established.

  • point
    Contains the location of the cursor, in pixels, relative to the screen.

Return Value

Nonzero if the drop is successful; otherwise 0.

Remarks

The framework first calls OnDropEx. If the OnDropEx function does not handle the drop, the framework then calls this member function, OnDrop. Typically, the application overrides OnDropEx in the view class to handle right mouse-button drag and drop. Typically, the view class OnDrop is used to handle simple drag and drop.

The default implementation of COleDropTarget::OnDrop calls CView::OnDrop, which simply returns FALSE by default.

For more information, see IDropTarget::Drop in the Windows SDK.

Requirements

Header: afxole.h

See Also

Reference

COleDropTarget Class

Hierarchy Chart

COleDropTarget::OnDragOver

COleDropTarget::OnDragEnter

COleDropTarget::OnDropEx