I have a very large delphi applicaiton 1500+ screeens, that is a Host application. I have created a .NET WPF Hydra Visual Plugin that implements the Developer Express .NET WPF DXRichEdit & DXRibbon control. One of the features I’d like to support is the ability to Drag a MergeField Definition (custom Object) from Delphi TreeView into the Visual Plugin and drop it on the DXRichEdit.
Does anyone have an example of any kind of a DragDrop Implemention from a Delphi Host to .NET WPF Visual Plugin?
Hi, the problem here is in the way how Delphi implements drag and drop. Basically Delphi own implementation only allows you to use drag and drop within your own application but doesn’t allow you to pass data to other apps. Despite your WPF plugin is embedded in the Delphi app, .NET doesn’t know anything about Delphi own way to do drag and drop, and unfortunately Hydra can’t change how this works.
So, to do what you need you must use OLE Drag and Drop, and this is where things get complicated, the problem is that Delphi doesn’t provide any class that implements MS interfaces such as IDropTarget or IDropSource, so you need to write your own implementation for them.
I can suggest you to use “Drag and Drop Component Suite” library (http://melander.dk/delphi/dragdrop/), its free, comes with full source codes and does exactly what you need.
I’ve attached a small example that uses this component suite (not included in zip) to demonstrate how this works (WPF side supports this by default), hope this helps.