Article ID: 139648
Article Last Modified on 11/21/2006
DROPEFFECT CMainView::OnDragOver(COleDataObject*,
DWORD grfKeyState, CPoint point)
{
// adjust target rect by original cursor offset
point -= m_dragOffset;
// check for point outside logical area (in hatched region)
// GetTotalSize() returns the size passed to SetScrollSizes
CRect rectScroll(CPoint(0, 0), GetTotalSize());
CRect rectItem(point,m_dragSize);
rectItem.OffsetRect(GetDeviceScrollPosition());
DROPEFFECT de = DROPEFFECT_NONE;
CRect rectTemp;
if (rectTemp.IntersectRect(rectScroll, rectItem))
{
//... figure out the drop effect
}
//...update drop effect
return de;
}
However, for some objects, such as Microsoft Word version 6.0 Documents,
the m_dragSize reported by the data object is (0,0). In this case, the call
to IntersectRect returns FALSE, and the drop effect returned is
DROPEFFECT_NONE.
if (rectItem.IsRectEmpty())
{
// Some applications might have a null size in the object descriptor
rectItem.InflateRect(1,1);
}
Additional query words: 0Client drag/drop Word
Keywords: kbdragdrop kbprb KB139648