Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DragEventArgs between apps
Message
From
08/06/2010 11:20:14
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
DragEventArgs between apps
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01467922
Message ID:
01467922
Views:
121
Hi,

I've implemented drag/drop between instances of the same sub-classed TreeView passing a reference to the TreeView itself as the DataObject. So starting the drag I have :
DataObject d = new DataObject(typeof(SWC.TreeView), this);
const DragDropEffects de = DragDropEffects.Copy;
DragDrop.DoDragDrop(this, d, de);
and in OnDrop():
if (e.Data.GetDataPresent(typeof(SWC.TreeView)))
SWC.TreeView t = (SWC.TreeView)e.Data.GetData(typeof(SWC.TreeView));
This works fine between TreeViews within the same instance of the application but when used between instances the GetData() line throws a ComException 'Invalid tymed'.
I *think* this is because COM only supports a fixed number of formats for drag/drop (and obviously my class is not amongst them :-{ )
(http://msdn.microsoft.com/en-us/library/ms691227(VS.85).aspx)

Any suggestions for a workaround?
(This is actually in WPF but AFAIK the DragDrop is the same as in WinForms)
Reply
Map
View

Click here to load this message in the networking platform