Export to GitHub

gong-wpf-dragdrop - issue #29

Dragging data between two instances of the application causes Invalid tymed (Exception from HRESULT: 0x80040069 (DV_E_TYMED)) exception


Posted on Dec 7, 2010 by Happy Camel

What steps will reproduce the problem? 1. Implement IDragSource. 2. Start drag of data (row from wpf datagrid in my case) 3. Add clone of user-defined data to the IDragInfo.Data object in StartDrag. 4. Drag over the same datagrid in second instance of application.

What is the expected output? What do you see instead?

The expected output would be the cloned data added to the datagrid. In the DragOver and Drop events I would handle any data issues. However, I never get that far because the Invalid tymed (Exception from HRESULT: 0x80040069 (DV_E_TYMED)) exception is raised by the O/S at line 135 in GongSolutions.Wpf.DragDrop.DropInfo.cs (code is Data = (e.Data.GetDataPresent(dataFormat)) ? e.Data.GetData(dataFormat) : e.Data;).

What version of the product are you using? On what operating system? 0.1.3 (Assembly version) - I built from source Windows XP

Please provide any additional information below.

Exception details follow:

System.Runtime.InteropServices.COMException was unhandled by user code Message=Invalid tymed (Exception from HRESULT: 0x80040069 (DV_E_TYMED)) Source=mscorlib ErrorCode=-2147221399 StackTrace: at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) at System.Windows.DataObject.System.Runtime.InteropServices.ComTypes.IDataObject.GetData(FORMATETC& formatetc, STGMEDIUM& medium) at System.Runtime.InteropServices.ComTypes.IDataObject.GetData(FORMATETC& format, STGMEDIUM& medium) at System.Windows.DataObject.OleConverter.GetDataInner(FORMATETC& formatetc, STGMEDIUM& medium) at System.Windows.DataObject.OleConverter.GetDataFromOleHGLOBAL(String format, DVASPECT aspect, Int32 index) at System.Windows.DataObject.OleConverter.GetDataFromBoundOleDataObject(String format, DVASPECT aspect, Int32 index) at System.Windows.DataObject.OleConverter.GetData(String format, Boolean autoConvert, DVASPECT aspect, Int32 index) at System.Windows.DataObject.OleConverter.GetData(String format, Boolean autoConvert) at System.Windows.DataObject.GetData(String format, Boolean autoConvert) at System.Windows.DataObject.GetData(String format) at GongSolutions.Wpf.DragDrop.DropInfo..ctor(Object sender, DragEventArgs e, DragInfo dragInfo) at GongSolutions.Wpf.DragDrop.DragDrop.DropTarget_PreviewDragOver(Object sender, DragEventArgs e) at GongSolutions.Wpf.DragDrop.DragDrop.DropTarget_PreviewDragEnter(Object sender, DragEventArgs e) at System.Windows.DragEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) at System.Windows.OleDropTarget.RaiseDragEvent(RoutedEvent dragEvent, Int32 dragDropKeyStates, Int32& effects, DependencyObject target, Point targetPoint) at System.Windows.OleDropTarget.MS.Win32.UnsafeNativeMethods.IOleDropTarget.OleDragOver(Int32 dragDropKeyStates, Int64 point, Int32& effects) InnerException:

Comment #1

Posted on Dec 7, 2010 by Happy Camel

A little more info....

It appears the real problem is when I set the IDragInfo.Data to a System.Windows.DataObject object. I am attaching a sample application to demo the problem.

To see the error, perform the following steps. Run two instances of the application, attempt to drag an item from the listbox between the two instances.

The reason I am using a DataObject is I need to allow for file-drop to the O/S as well.

Attachments

Comment #3

Posted on Jul 8, 2014 by Massive Ox

Hey Cheaster, where you able to figure anything out for this issue?

Status: New

Labels:
Type-Defect Priority-Medium