2

This C++ code shows how OLE can be used to simulate a file drag and drop to simulate a 'Send to...' operation. This will open the standard mail client with the selected file(s) as an attachment, a very interesting alternative to the mailto: protocol handler.

Which is the best (short and safe) way to create the neccessary instance of IDataObject in Delphi?

I have found some code here but maybe there is a better solution.

mjn
  • 36,362
  • 28
  • 176
  • 378

1 Answers1

3

Porting the C++ code to Delphi probably isn't too difficult. Start with

type
  TDataObject = class(TInterfacedObject, IDataObject)

and implement the required methods as shown in the C++ example.

Ondrej Kelle
  • 36,941
  • 2
  • 65
  • 128
  • Yes I agree it actually looks not so hard to port. Maybe I could use the GetUIObjectOf method of IShellFolder, see my Delphi code example link, without implementing IDataObject. – mjn Jun 10 '09 at 17:31