共用方式為


COleControl::GetWindowlessDropTarget

Override GetWindowlessDropTarget when you want a windowless control to be the target of an OLE drag and drop operation.

virtual IDropTarget* GetWindowlessDropTarget( );

Return Value

Pointer to the object's IDropTarget interface. Since it does not have a window, a windowless object cannot register an IDropTarget interface. However, to participate in drag and drop, a windowless object can still implement the interface and return it in GetWindowlessDropTarget.

Remarks

Normally, this would require that the control's window be registered as a drop target. But since the control has no window of its own, the container will use its own window as a drop target. The control simply needs to provide an implementation of the IDropTarget interface to which the container can delegate calls at the appropriate time. For example:

IDropTarget* CMyAxCtrl::GetWindowlessDropTarget()
{
   m_xDropTarget.AddRef();
   return &m_xDropTarget;
}

Requirements

Header: afxctl.h

See Also

Reference

COleControl Class

Hierarchy Chart

Other Resources

COleControl Members