I am quite puzzled how this is actually possible.
In my application (.NET framework 4.0) I have a "paste button". On application startup or when the focused object changes, I check the data in the clipboard to set the enabled state of that button.
Now it happend several times (on one machine) that this function seems to deadlock. Take a look at that stacktrace:
at System.StubHelpers.InterfaceMarshaler.ConvertToManaged(IntPtr pUnk, IntPtr itfMT, IntPtr classMT, Int32 flags)
at System.Windows.Forms.UnsafeNativeMethods.OleGetClipboard(IDataObject& data)
at System.Windows.Forms.Clipboard.GetDataObject(Int32 retryTimes, Int32 retryDelay)
at System.Windows.Forms.Clipboard.GetDataObject()
at XXX.Forms.ClipboardHelper.<GetClipboardType>b__5()
at XXX.DataProvider.Executor.Execute[TResult](Logger logger, LogLevel level, Func`1 action, Boolean throwUp, TResult defaultValue, String format, Object[] arguments)
at XXX.DataProvider.Executor.Catch[TResult](Logger logger, LogLevel level, Func`1 action, TResult defaultValue, String format, Object[] arguments)
at XXX.DataProvider.Executor.Catch[TResult](Logger logger, Func`1 action, TResult defaultValue, String format, Object[] arguments)
at XXX.Forms.Ribbon.RibbonFormHelper.IsPasteButtonEnabled()
at XXX.Forms.StartForm.XXX.Forms.IClipboardViewer.EnablePasteButton()
at XXX.Forms.Ribbon.RibbonFormHelper.OrderOverview_FocusChangedEvent(Object sender, EventArgs e)
at DevExpress.XtraVerticalGrid.VGridControlBase.ActivateEditor(RowValueInfo cell)
at DevExpress.XtraVerticalGrid.NormalState.MouseDown(MouseEventArgs e)
at DevExpress.XtraVerticalGrid.BaseHandler.MouseDown(MouseEventArgs e)
at DevExpress.XtraVerticalGrid.VGridControlBase.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)
at DevExpress.XtraVerticalGrid.VGridControlBase.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at XXX.Program.Main(String[] args)
So even if I have a large amount of data in the clipboard it should finish eventually. I waited several minutes...
Now it works again but I'd still like to know what was going on!