Click to See Complete Forum and Search --> : URGENT : How to drag and drop items between two CListCtrl ??


StéphaneDebono
April 6th, 1999, 03:02 AM
Hi,

My project is a dialog box based application. I have several list controls (CListCtrl). I need to allow drag and drop of items between these controls.
How can I do ?? It is very important for my project, please help.

Waiting for your reply,

Best regards,

Stéphane.

real name
April 6th, 1999, 06:01 AM
look at mfc demo-source comon-controls (cmnctrl-s), there is example for drag and drop inside treectrls and listctrl
you need to use the same but in begin-drag and mouse-move you will not give this-ptr (wnd of actual control) but NULL and coordinates you need recalcutale from client to screen
this way you will able to drag-drop over full screen
during mouse-up you will do test coordinates with another-ctrl-ptr->hit-test() (or something like this)
maybe this helps you

StéphaneDebono
April 6th, 1999, 09:40 AM
Well, I tried what you told me. However, if now I'm able to drag all over the screen, when I drop the item, it comes back in its parent list ctrl. When I try to use HitTest it gives me Access Violation error !! My three list ctrl have each a variable of CMyListCtrl associated, but I can't use them in the CMyListCtrl::OnMouseUp function !!!!

Please help Stephane.