Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.


Called by the framework when the user releases a data object over a valid drop target.

virtual BOOL OnDrop(
   COleDataObject* pDataObject,
   DROPEFFECT dropEffect,
   CPoint point 



Points to the COleDataObject that is dropped into the drop target.


The drop effect that the user has requested.

  • DROPEFFECT_COPY   Creates a copy of the data object being dropped.

  • DROPEFFECT_MOVE   Moves the data object to the current mouse location.

  • DROPEFFECT_LINK   Creates a link between a data object and its server.


The current mouse position relative to the view client area.

Nonzero if the drop was successful; otherwise 0.

The default implementation does nothing and returns FALSE.

Override this function to implement the effect of an OLE drop into the client area of the view. The data object can be examined via pDataObject for Clipboard data formats and data dropped at the specified point.


The framework does not call this function if there is an override to OnDropEx in this view class.

Community Additions

© 2015 Microsoft