May 22nd, 1999, 01:58 PM
When I use the LButtonDown for Drag and Drop, The control never recieves a ButtonUp. I made a class from a CListBox, and my code looks like this:
void ListBox::OnLButtonDown(UINT nFlags, CPoint point)
{
COleDataSource* pSource = new COleDataSource();
CSharedFile sf(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT);
CString text = _T("Testing 1... 2... 3...");
sf.Write(text, text.GetLength()); // You can write to the clipboard as you would to any CFile
HGLOBAL hMem = sf.Detach();
if (!hMem) return;
pSource->CacheGlobalData(CF_TEXT, hMem);
pSource->DoDragDrop();
CListBox::OnLButtonDown(nFlags, point);
}
What am I doing wrong?
void ListBox::OnLButtonDown(UINT nFlags, CPoint point)
{
COleDataSource* pSource = new COleDataSource();
CSharedFile sf(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT);
CString text = _T("Testing 1... 2... 3...");
sf.Write(text, text.GetLength()); // You can write to the clipboard as you would to any CFile
HGLOBAL hMem = sf.Detach();
if (!hMem) return;
pSource->CacheGlobalData(CF_TEXT, hMem);
pSource->DoDragDrop();
CListBox::OnLButtonDown(nFlags, point);
}
What am I doing wrong?