开发者

Why is OnDragEnter not called?

开发者 https://www.devze.com 2022-12-23 01:24 出处:网络
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 ye

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消