I managed to implement in asm the interfaces for IDropSource, IDataObjcet and IEnumFORMATETC ... and now I have a working drag-drop server that allows me to drag files in Explorer!!
Need now to implement the IDropTarget class (easy) and will then post the source with a working example on how to use them!
This might take a while cauz I'm going on holiday in 2 days ...

Assuming of course that somebody is interested in OLE Drag-Drop that is.

I love asm

Posted on 2001-11-29 02:55:24 by random
that's awesome random :)

good job :alright:
Posted on 2001-11-29 05:36:16 by Hiroshimator
Ok ... here it is (a bit earlier than I expected ;) )

There is not much in terms of explanations / comments, as I really hate writing those
Anyway, there are plenty of tutorials on the net covering OLE Drag/Drop in VC++ ... and if you don't know C++ then you shouldn't be reading this anyway ;)

What it is:
This are the iterfaces for IDataObject, IDropSource, IDropTarget and IEnumFORMATETC required to support basic OLE Drag Drop

The classes have been written with file transfers between the application and the shell in mind (i.e. for the CF_HDROP shell data transfer format), but can easily be modified to support any other (e.g. CF_TEXT)

There is also a little example on how to use the classes. It's a little utility that acts like a drag and drop staging area. You can drag files into the app from the Explorer, you can then drag them out back to the Explorer to be copied in the destination folder. Easy!!

Note: I didn't use COLib because I really didn't have time to understand how it works (I started looking at COM on Monday, I got the original C++ sources on Tue and I'm posting this on Thursday ... give me a break ;) )

Take care
Posted on 2001-11-29 15:24:19 by random
it's ALIVE!!!
Posted on 2001-11-29 21:11:37 by cmax

Congratulations on a very nice serious bit of new work.

While I couldn't get the sample to work (not that I understood what it was doing), I know getting any of this working takes much skull work.

And no problem NOT using CoLib. I think it would please Bill to see how you used his work as a base.

Posted on 2001-11-29 21:36:23 by Ernie
Hmm... im with Ernie on this one, it doesnt seem to do all that much... (nothing really)...

Even tho i do get the cursor to change when i try to drag an drop something.. but thats all i see. ????

Im using windows 98SE...

However, im very curious as to the implications your work can offer....

Posted on 2001-11-29 22:29:21 by NaN
Dunno ... it works on my 2 win2k machines, didn't have time to test it on a win98.
Maybe there is something in the example code (don't think in the interfaces) that doesn't work properly with w9x.

In win2k, at least, just drag the files from the explorer and drop them in the test window, where a list of the dropped files will be displayed

let me know

Posted on 2001-11-30 04:04:52 by random
ya random, it don't work for 9x. You got to test your work on both types before ever releasing anything i think ...Special work that looks as good as your does. Made since to me, but who am i...
Posted on 2001-11-30 07:42:37 by cmax
Yeah well, I don't have win98 pcs ... anyone has a spare one ? :)

And has any1 with win2k tested it yet?

ps: it's not a release or anything ... just free code I'm sharing for the pleasure of sharing ;)
Posted on 2001-11-30 09:38:25 by random

I've tried it on 95, 98, NT and 2K, and the only one I got it to work on was 2K.

I'll have to have a close look at your code and try to work out what I'm doing wrong in mine, thanks for sharing the source so quickly.

Posted on 2001-11-30 09:44:39 by Nick
mmhhh ... do you get the window with the listview control?

if not, just add InitCommonControls at WM_CREATE

let's see ... it could be the RegisterClipboardFormat

I'll try to get access to a win98 installation next week and with a debugger should take only few minutes to figure it out

Posted on 2001-11-30 09:53:40 by random
tested on a win98se and it works ... can't explain

that's it folks for this week

take care
Posted on 2001-11-30 13:07:30 by random
If you edit in debug routines (vkim's stuff or what ever), to make an output log at evey key point, i will run and test it for you on my machine and send you back the log (if you think it will help..)

Posted on 2001-11-30 15:43:03 by NaN
I tried at work on 2k machine. It worked but when i got home on my 95 it did not. At lease i now know that if i send something not completly tested i don't have to be shy about it. It be great to see it working for 95 too. It's to heavy for me, i don't know com yet. See ya
Posted on 2001-11-30 16:36:44 by cmax
very good job, random :alright:

There seems t? be an error in structure FORMATETC.

Old version:

cfFormat DWORD ?
ptd DWORD ?
dwAspect DWORD ?
lindex LONG ?
tymed DWORD ?

New version:

cfFormat WORD ?
reserved WORD ?
ptd DWORD ?
dwAspect DWORD ?
lindex LONG ?
tymed DWORD ?

After changing all places it works with Win9x

Here is a version running with Win9x separated into several source files (thats for technical reasons because VC cannot properly handle included ".ASM" files).
Posted on 2001-12-02 05:56:15 by japheth
That seems to be it.. works on 98SE now...

Good eye Japheth...

Posted on 2001-12-02 11:44:07 by NaN