Hello,<br><br>(Nice to see that tek-tips is up again !)<br><br>I've got troubles with Ole drag'n'drop. I can not make it work in not CView-derived classes. I thought I have found a (logical) solution, but (unfortunately) it obviously doesn't work so I will explain this in detail.<br><br>I have succefully implemented Ole drag'n'drop in my<br>child windows of my MDI application, by<br>adding the following members and methods to the view<br>classes of my MDI childs :<br><br><br>#include <afxole.h> // for COleDropTargetclass myChild<br>class MyView: public CView<br>{<br>[...]<br>protected:<br> COleDropTarget m_oleDropTarget;<br>[...]<br>public:<br> virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject,<br> DWORD dwKeyState, CPoint point); virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject,<br> DWORD dwKeyState, CPoint point);<br> virtual void OnDragLeave();<br>virtual BOOL OnDrop(COleDataObject* pDataObject, <br>DROPEFFECT dropEffect, CPoint point);<br> virtual DROPEFFECT OnDropEx(COleDataObject* pDataObject,<br> DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint<br>point);<br>[...]<br>protected:<br>[...]<br> afx_msg void OnLButtonDown(UINT nFlags, CPoint point); // in order to start drag'n'drop<br>[...]<br>};<br><br><br>and I register the COleDropTarget in the OnCreate<br>member as follows:<br><br><br>if (!this->m_oleDropTarget.Register(this))<br>{<br> ASSERT (FALSE);<br> CString csComObjectErrorMsg; <br> csComObjectErrorMsg.LoadStrin (IDS_COM_OBJECT_ERROR); <br> AfxMessageBox(LPCSTR(csComObjectErrorMsg)); return -1;<br> }<br><br><br>But when I try this (in fact only the drop side<br>interest me) on the CMDIFrameWnd, it doesn't work<br>(drop not allowed). I have thought this was because<br>the CMDIFramWnd does not heritate from CView so it is<br>not possible to overload the member OnDragEnter,<br>OnDrop and so on. So, I write my own object derived<br>from COleDropTarget :<br><br><br><br>class CMainFrameOleDropTarget : public<br>COleDropTarget<br>{<br>public : //constructor/destructor<br> CMainFrameOleDropTarget() {}<br> virtual ~CMainFrameOleDropTarget() {}<br> //surcharge of some handler :<br> // Drop<br> virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject,<br> DWORD dwKeyState, CPoint point); virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject,<br> DWORD dwKeyState, CPoint point); virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);<br>};<br><br><br>And make a attribute of kind CMainFrameOleDropTarget<br>in my frame windows class that I register as before in<br>the OnCreate member.<br><br>But it didn't work either (why ?!).<br><br>Notice that I want to implemented feed-back so I need this Ole-drag'n'drop and not the other (and easier) drag'n'drop with only 'OnDrag'.<br><br>Any idea or succesfull experience with not CView derived class ? Thanks,<br><br>David Burg.<br>