![]() Last edit: 98-06-29 Graham Wideman |
Delphi |
Delphi OLE Drag and Drop: Comments on Books Article created: 98-06-26 |
The following comments are intended to extend the material on OLE drag and drop found in various books, and are not meant as a devaluation of the authors' valiant works!
High Performance Delphi 3 Programming (Jim Mischel)
Delphi Developer's Handbook (not sure which author)
I felt that COM is loaded with enough complicated conceptual baggage as it is, and I prefered to see and manipulate only the parts that related to COM, and set aside the extra apparatus (and elegance) of a VCL component for my example code. Along the way I developed a suspicion that flexibility to implement a variety of OLE-drop behaviors might actually be hard to "parametrize" in a VCL component's properties, and instead it's perhaps easier to get what you want with ordinary objects. The jury's still out on that one!
Inside OLE 2 (first and second editions)
It may be the bible of OLE, but it's at a level that's a tad too deep in OLE terminology and concepts to wade into if you've never seen OLE before. It's been several years since I bought the book, and now that I know a lot more about OLE/COM, Java and about O-O systems in general, I can go back and see what this book is talking about. So, if you're tempted to start here, it might be better to pick a gentler introduction first. There's a heck of a lot of stuff here that you don't need to know if you are going to use Delphi.
On a finer point, I was a little unnerved to see a discussion of CoLockObjectExternal (needed for DropTarget) which amount to "no one really knows why, it has something to do with preventing the system from killing your COM object, and we're pretty sure it's a design flaw, but trust me, you have to use it". (Bear in mind that Kraig B's official job at MS was to explain COM) That, coupled with Jim M's extra AddRefs is what motivated the extra attention to the DropTarget create and destroy process in my example code.
Go to: Drop Demo Intro Page, or