Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenClipboard Failed (Exception from HRESULT: 0x800401D0 (CLIPBRD_E_CANT_OPEN)) #33

Closed
ghost opened this issue Mar 16, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Mar 16, 2015

While working with the Snoop WPF utility. Got this error very frequent.

Message: OpenClipboard Failed (Exception from HRESULT: 0x800401D0 (CLIPBRD_E_CANT_OPEN))
Stacktrace:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo)
at System.Windows.Clipboard.Flush()
at System.Windows.Clipboard.CriticalSetDataObject(Object data, Boolean copy)
at System.Windows.Clipboard.SetDataInternal(String format, Object data)
at System.Windows.Clipboard.SetText(String text, TextDataFormat format)
at System.Windows.Clipboard.SetText(String text)
at Snoop.EditedPropertiesHelper.DumpObjectsWithEditedProperties()
at Snoop.SnoopUI.OnClosing(CancelEventArgs e)
at System.Windows.Window.WmClose()
at System.Windows.Window.WindowFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(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)

@nwolverson
Copy link

Duplicates #12 #14.

Been having this issue in another application recently, and as per http://stackoverflow.com/questions/12769264/openclipboard-failed-when-copy-pasting-data-from-wpf-datagrid switching to SetDataObject seemed to resolve the issue.

bdurrani added a commit to bdurrani/snoopwpf that referenced this issue Jul 29, 2017
shelm pushed a commit to hcmlab/nova that referenced this issue Oct 24, 2017
@batzen batzen self-assigned this May 20, 2019
@batzen batzen added the bug label May 20, 2019
@batzen batzen added this to the 2.11 milestone May 20, 2019
@batzen
Copy link
Collaborator

batzen commented May 27, 2019

I fixed this a while ago by forwarding all Clipboard usages to a helper class which uses System.Windows.Forms.Clipboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants