Win32/OLE Drag and Drop C/C++

I spent hours digging into google to find some information or tutorial on how to implement drag and drop with pure Win32.

I ended up with this great result:

section under OLE tutorial discuses drag and drop, but as I read the tutorial
I would like to ask you for any additional good reference such as this one to help learn drag and drop.

surely there must be some starting point where you started learning this stuff, I look forward that you share this info here :)

also sample code that is compileable should be great too.
Not an answer. But using C# .Net on Visual Studio lets you implement it through a simple setting. Might be worthwhile to switch from Win32 to .Net, or maybe not (depends on your project).
malibor wrote:
surely there must be some starting point where you started learning this stuff, I look forward that you share this info here :)

I pretty much always start straight from the horse's mouth. or
the same site just a different filter on searches

Some links may not work, I think this is an effort to bring all the Microsoft Info Silos together and it is ongoing...
Grey Wolf,
the links you posted tell nothing about drag and drop, what are you trying to say?

Yes, I do read MSDN docs, but when it comes to drag and drop it tells so little that there is no other but to turn to other sites.
Not many C++ coders do low level OLE/COM Malibor (as you are finding out). I checked out your Catch 22 site. Looks like good stuff. I recall finding something there years ago that was useful to me when I was creating my own C Runtime to replace the one furnished by Microsoft.

Almost all C++ coders use various wrapper libraries provided by Microsoft such as MFC or ATL to deal with OLE/COM. I discovered that many years ago when I was attempting to create ActiveX Controls myself with low level COM. All this most certainly CAN BE done with low level COM and no helper libraries, but the learning curve is very, very steep, and you almost have to figure it all out yourself one small piece at a time.

COM has always been one of my main interests, but unfortunately, I never explored 'Drag and Drop'. As mentioned above, my main interests were component architectures and Active X Controls. A possible source of info for you might be this as a start.....

Its Win32 PowerBASIC, which might put you off, but believe me, its not .NET, Visual Basic, or anything like that - its pure low level Win32.
malibor wrote:
the links you posted tell nothing about drag and drop, what are you trying to say?
I was suggesting that you search there for OLE Drag and Drop as there is a lot of information there...I may have misunderstood your level of knowledge of COM(?).

As freddie1 alludes to, information on COM/OLE is not the easiest thing to find. Two books that I used to learn COM back in the day where:

Inside COM
by Dale Rogerson

Essential COM
by Don Box

I don't know how much COM has changed since then, I've been in the wilderness of .net for far too long.

This is what I was thinking you would find. Starting at COM digging down to OLE and Data Transfer and a bit deeper to Drag and Drop
freddie1, thank you for the link, yes I see COM is hard to learn not because it's hard but because of the lack of learning material.

Grey Wolf,
Thanks for book recommendation, I already have "Essential COM", but can't google out pdf for the other one :(

Even though none of these 2 books show how to implement drag and drop they are good for learning COM.
It doesn't matter anyway as I already grasped drag and drop with sample code from catch22 site.
Without that site which was so hard to find I think I'll never leran this, and I see so many people ask for help about drag and drop and none got complete answer such as on catch22 site.

hopefully this thread will help future drag and drop seekers.

I already grasped drag and drop with sample code from catch22 site

Good for you!

Back in the 1st decade of the 21th century, a wildly popular way of learning COM for those who truly wanted to know, was Jeff Glatt's online tutorials starting here....

That one is 'COM In Plain C', but there were many others, but I'm not sure whether he tackled Drag And Drop or not. It would be pretty easy to check.

The reason Jeff Glatt's work was so popular is that the way C++ works hides the Object Model COM uses to standardize object creation and destruction, and COM is going to forever remain mysterious to C++ coders who never look at it from the angle of C and the building of the Virtual Function Tables (Interfaces) that form the basis of COM.

It is for those reasons that 'COM In Plain C' was also popular among low level PowerBASIC Win32 coders, as to access such entities as ActiveX Controls, or, more generally, COM Objects, from that language, one had to see and understand the low level memory structures, and recreate them in PowerBASIC with memory allocations and structs/types as is done in C. The wrapper libraries C++ coders used to absolve themselves of the need to understand these things were of no use in languages other than C++. And one of the fundamental ideas behind the Component Object Model was that it was to be language neutral, i.e., an object based technology usable in any language 'powerful' enough to use pointers and memory allocations.

not sure if this works in the OLE or COM world but at the program level, drag and drop can be accessed via argv/argc in main.

outside of that, widgets like text boxes have a setting for allow D&D that does most of the work for you.

My apologies if those don't work in the OLE/COM realm. I just know they are the 'simple starting point' for D&D in 'normal' windows programs.
Topic archived. No new replies allowed.