I have added the COleDropTarget variable to my view class and registered it in the OnCreate(), which is being called at startup. I added the OnDragEnter and OnDrop virtual functions (not the others yet, as OnDragLeave). But they are not called when I drag (or drop) a piece of text over them.
I just happened to think about the fact that I had already implemented the dropfiles function to the same window. Is this preventing the text drag?
What else开发者_JAVA百科 do I need?
TIA,
Harvey
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.
精彩评论