Create file using drag and drop

D

Darren

I'm trying to create a file using drag and drop.
I want to be able to select a listview item drag it to the shell and create a file.
Each icon in the listview represents a blob in a database.
When I drop onto the shell I want a file created with a specified name containing the data from the database.

I've looked at the FileDrop format but it look to have only the filename and not the data.

TIA
 
T

TerryFei

Hi Darren,
Welcome to MSDN Newsgroup!

Based on your requirement, I suggest you could use OLE Drag and Drop com
technique to achieve the goal.
The Source of the drag-drop is represented by the IDropSource interface.
The IDropSource contains methods for generating visual feedback, and for
canceling or completing the drag-drop operation. The Target of the
drag-drop is represented by the IDropTarget interface. The Data being
transferred is represented by the IDataObject interface.
So you could take out data form database and use IDropSource interface to
transfer it. And then create a new file with the data from IDropSource. You
could refer to the following article to get more information about OLE
Drag/Drop:
Part 1 - Introduction OLE Drag and Drop Introducing the OLE and COM
technologies.
http://www.catch22.net/tuts/dragdrop.asp

Part 2 - OLE Data Transfers All about OLE data types, storage mediums and
data formats.
http://www.catch22.net/tuts/dragdrop2.asp

Part 3 - Implementing IDataObject Standalone implementation of the
IDataObject interface.
http://www.catch22.net/tuts/dragdrop3.asp

Part 4 - Enumerating FORMATETC Standalone implementation of the
IEnumFormatEtc interface.
http://www.catch22.net/tuts/dragdrop4.asp

Part 5 - Drop Source Implementing the IDropSource interface.
http://www.catch22.net/tuts/dragdrop5.asp

Part 6 - Drop Target Implementing the IDropTarget interface.
http://www.catch22.net/tuts/dragdrop6.asp

I hope the above information is helpful for you. If you have any questions,
please feel free to let me know. Thanks and have a nice day!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top