Click here to Skip to main content
15,867,453 members
Articles / Desktop Programming / MFC

The Drag and Drop Interface Samples

Rate me:
Please Sign up or sign in to vote.
4.33/5 (5 votes)
9 Nov 2000 171.2K   3.9K   94   27
A series of articles that resulted from experimenting with adding Drag and Drop features to my existing application

This article is part of the drag and drop interface samples:

  1. Serializing ASCII Data
  2. Modeless child dialog
  3. Modeless sibling dialog
  4. The drag source
  5. The MFC drop target
  6. The TBTextTarget class

Preface

This is a series of articles that has yielded from experimenting with adding some Drag and Drop features to my already-existing application. Due to the complexity of the task, I split the article in several small documents that may easily fit into various CodeProject's sections.

Introduction

The idea was simple: I have an SDI application with a CFormView containing a however-you-like filled out CListCtrl in report view.

The first tricky thing was to use the doc/view architecture with a document file format containing ASCII-strings. Read about that quck'n'clean approach.

Next, I needed to batch-manipulate the data displayed in this control. "So why not use a kind of drag & drop interface with a modeless dialog box and let the user drag the rows he needs into that dialog..." I thought - and that's how this article starts.

You may download all sample MSVC (6.0) projects at once or you can fetch the code for each of these steps:

I'm looking forward to hearing your comments and improvements.

License

This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.

A list of licenses authors might use can be found here.


Written By
Web Developer
Germany Germany
PhD Chemist,
programming with MSVC & MFC since 1996

Comments and Discussions

 
Questioncan not download it Pin
fishcar2856-Sep-12 16:52
fishcar2856-Sep-12 16:52 
AnswerRe: can not download it Pin
Thomas Blenkers9-Sep-12 9:14
Thomas Blenkers9-Sep-12 9:14 
GeneralInteresting Pin
SB200322-Nov-10 23:02
SB200322-Nov-10 23:02 
Generalexcellent Pin
XPointer27-Sep-06 0:28
XPointer27-Sep-06 0:28 
GeneralSame View Pin
picazo8-Mar-06 11:57
picazo8-Mar-06 11:57 
AnswerRe: Same View Pin
Thomas Blenkers11-Mar-06 2:25
Thomas Blenkers11-Mar-06 2:25 
Hello Genaro,

there is absolutely nothing wrong in dragging between two different list controls on the same view.

All you have to do is implement the source and the target interfaces in the same view.

If you plan your interface to be enable to drag from and drop to both controls, the only thing that is extra needed is some code to remember from which one of your controls you dragged the text.

Regards
Thomas
QuestionHow can i control and prohibit drag & drop? Pin
atsuki10-Mar-05 19:59
atsuki10-Mar-05 19:59 
QuestionHow to drag & drop between tow UI(User Interface) threads? Pin
16-Aug-03 21:31
suss16-Aug-03 21:31 
AnswerRe: How to drag & drop between tow UI(User Interface) threads? Pin
yu_cg17-Oct-07 17:22
yu_cg17-Oct-07 17:22 
GeneralMissing Files Pin
Darren Schroeder11-Nov-00 2:57
Darren Schroeder11-Nov-00 2:57 
GeneralRe: Missing Files Pin
rajas20-Apr-03 5:41
rajas20-Apr-03 5:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.