views:

66

answers:

1

I am trying to add drag-and-drop text to my Doc-View App. I added the COleDropTarget variable to the view class, registered it in OnCreate(). I added OnDragEnter(), OnDragOver(), OnDragLeave() and OnDrop() to that class as virtual overrides, but none of them are ever called. I previously had added m_pMainWnd->DragAcceptFiles(TRUE); to my App class. I tried commenting out that statement, but no affect.

I tried using Spy++ to see where the messages go while I do a drag, but it logs nothing at all while I am dragging the text around in the App.

What do I need? Or what else can I try, to narrow down the problem?

TIA,

Harvey

+1  A: 

Solved:

In using F1 to get the syntax for OnDrop and the others, MSDN gave me:

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

But the correct virtual function does not have the first parameter and should be:

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

Same with the others. So I was never actually overriding the default functions.

Harvey