OLE Drag & Drop

Updated 6 Dec 2006

Many thanks to Davide Chiodi from Italy who has very kindly converted the drop-source code into a Pure C implementation

Welcome to the fifth article in the "OLE Drag and Drop" tutorial series! We are almost at the final stages in our OLE drag and drop implementation. The only thing left to do is implement the IDropSource and IDropTarget interfaces. Once we have done this we will be ready to add drag and drop to any application..

This tutorial will concentrate on implementing a COM object which exposes the IEnumFORMATETC interface. There are two code downloads this time. The first includes a complete implementation of a generic IEnumFORMATETC which you can use in your applications.

Updated 6 Dec 2006

Many thanks to Davide Chiodi from Italy who has very kindly converted the data-obect code into a Pure C implementation - the download link is available at theĀ bottom of this article!

In the last part of the tutorial we looked at how to access the Windows clipboard using OLE and the IDataObject. In this part we will be implementing the IDataObject interface, and using our completed data object to store the text "Hello World" into the Windows clipboard.

Welcome to the second article in the "OLE Drag and Drop" tutorial series! The purpose of this article is to explore how data is represented and transferred between applications in the OLE environment.

The very heart of OLE data transfers is the IDataObject COM interface. An IDataObject provides a method of transferring and accessing data from one application to another. The most common use of OLE data transfers is the Windows clipboard, and of course drag and drop. The IDataObject is effectively a COM wrapper around one or more items of data.

The aim of this series of tutorials is to enable the reader to implement complete drag and drop support for their applications. Drag and drop became a standard feature of many Windows applications when Windows 95 was launched. With COM and OLE becoming more mainstream at this time, applications had the power to interact seamlessly with the Windows Shell and even other Windows applications. This flexibility came at a price though. Writing any form of COM or OLE enabled appliction is a complete nightmare, to put it mildly.

The aim of this series of tutorials is to enable the reader to implement complete drag and drop support for their applications. Drag and drop became a standard feature of many Windows applications when Windows 95 was launched. With COM and OLE becoming more mainstream at this time, applications had the power to interact seamlessly with the Windows Shell and even other Windows applications. This flexibility came at a price though. Writing any form of COM or OLE enabled appliction is a complete nightmare, to put it mildly.

Syndicate content