MFCDRAG Implements Drag&Drop Between CListCtrl & CTree

ID: Q148738


The information in this article applies to:
  • The Microsoft Foundation Classes (MFC), used with:
    • Microsoft Visual C++, 32-bit Editions, versions 4.0, 4.1, 5.0, 6.0


SUMMARY

MFCDRAG shows how to implement drag and drop between a CListCtrl and CTreeCtrl. The program creates a splitter window containing four panes. Two panes contain CListCtrls and the other two contain CTreeCtrls. You can drag an item from any window to another. For example, dragging can occur between the following panes:

CListCtrl to CTreeCtrl
CListCtrl to CListCtrl
CTreeCtrl to CListCtrl
CTreeCtrl to CTreeCtrl
Code marked with the comment "Added 7/29/96" was added to support a change in the CreateDragImage function in MFC 4.2. The CImageList pointer returned from CreateDragImage must now be explicitly deleted. If you are using a version of MFC prior to 4.2, please comment this code out.

The following files are available for download from the Microsoft Download Center. Click the file names below to download the files:


Mfcdrag.exe

For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

NOTE: Use the -d option when running MFCDRAG.EXE to decompress the file and recreate the proper directory structure.


MORE INFORMATION

Additional query words: drag drop

Keywords : kbfile kbprg kbsample kbMFC KbUIDesign kbVC kbVC400 kbVC410 kbVC500 kbVC600
Version : winnt:
Platform : winnt
Issue type :


Last Reviewed: January 31, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.