Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Drag 'N Drop

14 views
Skip to first unread message

Lee Westlake

unread,
Feb 1, 2004, 9:43:43 AM2/1/04
to
Does anyone know how I may implement drag and drop, for files/folders
that do not yet exist within the file system (i.e. the way WinZip
creates files from a compressed archive, after they have been
dragged/dropped onto the relevant target.)

The only information I currently have, involves the passing of a NULL
terminated path list for EXISTING file system entries. What I really
need, is either an event that allows me to create files after the
commencement of a drop operation, but before the drop target acquires
them, or preferably a method for obtaining the drop target path
directly.

The latter option would appear to furnish a most attractive solution,
as it avoids separate creation and copy/move operations.

Any help regarding this matter, would be very much appreciated.

Best regards

Lee Westlake (Lee_We...@yahoo.co.uk)

James Brown

unread,
Feb 1, 2004, 12:42:37 PM2/1/04
to
Lee,
You will need to use OLE drag and drop (COM objects and all that),
I assume you are doing this already...

You basically need to support two clipboard types in your IDataObject -
the FileContents and FileGroupDescriptor types. If you also support the
IStream transport medium this provides a very efficient method of streaming
arbitrary data into a non-existing file, just as you want. When you drag a
data-object
supporting these types onto explorer, it will query your object for these
types and
call the appropriate methods to stream the data into the file (which it
creates for
you based on the FileGroupDescriptor info).

If you have the platform SDK (or visual studio tools), there is a tool in
one
of the \bin directories called "IDataObject Viewer"....if you start winzip
and drag
a file onto the IDataObject-viewer window, it will tell you what type of
IDataObject
winzip uses for it's drag and drop.

Finally, goto my website into the source-code section:

http://www.catch22.org.uk/source/

and download "hexview library" inside this zip file there is a hell of a lot
of code,
but there is some OLE drag+drop stuff as well, it's not very pretty but it
does do
what you want.

I'm in the process of writing a tutorial on OLE drag+drop for my website,
it's not ready
just yet but will be soon..

James
--
www.catch22.org.uk
Free Win32 Software, Source Code and Tutorials

"Lee Westlake" <lee_we...@yahoo.co.uk> wrote in message
news:e44q10tah00c5hi71...@4ax.com...

0 new messages