Drag and Drop
-
hello, I'm trying to implement drag and drop in my program, i'm using the drag nd drop classes by Leon Finker on CP. I had it working then noticed it now doesn't work, i have old source where it does work, but apart from things i changed in ftp classes etc there is not differnces, i've even copied the to window classes that implement drag and drop to the new src, and compiled it but still drag and drop fails. it fails on
RegisterDragDrop
the code i use is:dropTarget = new DropTarget(m_hWnd); if (dropTarget == NULL) return false; dropTarget->AddRef(); if (FAILED(RegisterDragDrop(m_hWnd, dropTarget))) { dropTarget = NULL; return false; } ...
This is from the drag and drop example Leon provides. and RegisterDragDrop always fails, but not in the other source, really annoying me. Anyone got any ideas of what this could be from? been trying to figure it out for ages! thanks in advance for any help. Luke EDIT: I'm using the WTL framework if that helps or matters -
hello, I'm trying to implement drag and drop in my program, i'm using the drag nd drop classes by Leon Finker on CP. I had it working then noticed it now doesn't work, i have old source where it does work, but apart from things i changed in ftp classes etc there is not differnces, i've even copied the to window classes that implement drag and drop to the new src, and compiled it but still drag and drop fails. it fails on
RegisterDragDrop
the code i use is:dropTarget = new DropTarget(m_hWnd); if (dropTarget == NULL) return false; dropTarget->AddRef(); if (FAILED(RegisterDragDrop(m_hWnd, dropTarget))) { dropTarget = NULL; return false; } ...
This is from the drag and drop example Leon provides. and RegisterDragDrop always fails, but not in the other source, really annoying me. Anyone got any ideas of what this could be from? been trying to figure it out for ages! thanks in advance for any help. Luke EDIT: I'm using the WTL framework if that helps or mattersOk, very strange I have 2 list views that are trying to do the drag and drop, i also have a RichEditCtrl and in its create method it calls its
SetReadOnly(TRUE);
method. which makesRegisterDragDrop
fail. So i put the readonly bit in theRichEdit.create(..., ES_READONLY)
bit but that makesRegisterDragDrop
fail. I think this is very weird, the RichEdit.create method gets called before the to listview get created, i'll try swaping them but, still this shouldn't be happening. any ideas? Luke.