Drag and Drop Text - What am I missing?

I am trying to add drag and drop text to a Doc-View application. I added the COleDropTarget variable to the view class, registered it with OnCreate (). I added OnDragEnter (), OnDragOver (), OnDragLeave (), and OnDrop () to this class as virtual overrides, but none of them are ever called. I previously added m_pMainWnd-> DragAcceptFiles (TRUE); to my class App. I tried to comment on this expression, but did not influence.

I tried using Spy ++ to see where the messages go while I drag and drop, but it doesn't write anything while I drag text in the application.

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

TIA

Harvey

+4
source share
1 answer

It is decided:

Using F1 to get the syntax for OnDrop and 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 thing with others. Therefore, I never redefined the default functions.

+1
source

Source: https://habr.com/ru/post/1303984/


All Articles