This is a migrated thread and some comments may be shown as answers.

DragDropManager might result: Error HRESULT E_FAIL has been returned from a call to a COM component.

0 Answers 209 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
itai
Top achievements
Rank 1
itai asked on 18 Mar 2012, 09:02 AM

while working with the Q3 11 controls, everything worked well with draging from the TreeView.

The current scenario is that we allow reordering of tree items, but we also allow dragging outside the tree.
When the dragged treeview item is being dragged over a specific control, we cancel the drag using:

 

Telerik.Windows.DragDrop.DragDropManager.AddQueryContinueDragHandler(solutionTree, solutionTree_QueryContinueDrag);

And then in the QueryContinueDrag do:

e.Action = DragAction.Cancel;

e.Handled = true;


And call (with a BeginInvoke) to a function on my classes that starts a DragDrop (using microsoft drag drop) with my own UI.


The exception happens after the drop.

All signs point to the fact that the exception comes from your code.


This is the stack stace:
   at MS.Win32.UnsafeNativeMethods.DoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
   at System.Windows.OleServicesContext.OleDoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect)
   at System.Windows.DragDrop.OleDoDragDrop(DependencyObject dragSource, DataObject dataObject, DragDropEffects allowedEffects)
   at System.Windows.DragDrop.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects)
   at Telerik.Windows.DragDrop.DragDropManager.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects, DragDropKeyStates initialKeyState, Object dragVisual, Point relativeStartPoint, Point dragVisualOffset)
   at Telerik.Windows.DragDrop.DragInitializer.StartDrag()
   at Telerik.Windows.DragDrop.DragInitializer.StartDragPrivate(UIElement sender)
   at Telerik.Windows.DragDrop.DragInitializer.DragSourcePreviewMouseMove(Object sender, MouseEventArgs e)
   at System.Windows.Input.MouseEventArgs.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.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at Unitronics.Shell.UI.App.Main() in C:\Users\itais\Desktop\NG\NG Projects\Sources\Unitronics.Shell\Unitronics.Shell.UI\obj\Debug\App.g.cs:line 0
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()




A similar problem was reported here:http://www.telerik.com/community/forums/wpf/draganddrop/app-crash-when-dropping-into-wordpad.aspx


Please fix it, or suggest a fix ASAP.

Thanks.

 

 

 

 

 

 

 

 

No answers yet. Maybe you can help?

Tags
DragAndDrop
Asked by
itai
Top achievements
Rank 1
Share this question
or