如何使用Delphi创建IDataObject实例?

时间:2022-11-25 08:14:20

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.

此C ++代码显示如何使用OLE来模拟文件拖放以模拟“发送到...”操作。这将打开标准邮件客户端,将所选文件作为附件,这是mailto:protocol处理程序的一个非常有趣的替代方法。

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

哪个是在Delphi中创建IDataObject的必要实例的最佳(简短和安全)方法?

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

我在这里找到了一些代码,但也许有更好的解决方案。

1 个解决方案

#1


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

将C ++代码移植到Delphi可能并不太困难。从...开始

type
  TDataObject = class(TInterfacedObject, IDataObject)

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

并实现C ++示例中所示的所需方法。

#1


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

将C ++代码移植到Delphi可能并不太困难。从...开始

type
  TDataObject = class(TInterfacedObject, IDataObject)

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

并实现C ++示例中所示的所需方法。