Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
925
Clipboard SetText exception on VMWare client
posted

Hi,

We having a problem when trying to use the Clipboard in our Xaml application with enabled Clipboard copy functionality. The clipboard functionality works perfectly fine on any other hardware, however the failing ones are virtual PC's with installed VMWare application (provided by VMWare Horizon Client) limiting the clipboard access due policies. Here is a stack trace:

System.Runtime.InteropServices.COMException (0x800401D0): OpenClipboard Failed (Exception from HRESULT: 0x800401D0 (CLIPBRD_E_CANT_OPEN))

   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(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 Infragistics.Controls.Editors.ClipboardManager.SetText(String text)

   at Infragistics.Controls.Editors.ViewSelectionManager.Copy()

   at Infragistics.Controls.Editors.ViewKeyboardHandler.OnKeyDown(KeyEventArgs& e)

   at Infragistics.Controls.Editors.Primitives.EditorDocumentViewPresenter.OnKeyDown(KeyEventArgs e)

   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)

   at System.Windows.Input.KeyEventArgs.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.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)

   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)

   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)

   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

We have tried various combinations with clipboard sample application and we face same problem when we try to use Clipboard.SetText(). However, we found a workaround for this error to use Clipboard.SetDataObject(object) for text and this works without any exception. Is there any chance to enhance logic to cover for Xaml to handle this at Infragistics side?

However, based on our tests it looks like this approach is affecting paste and application is hanging. We enabled in various places copy functionality like this:

<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings SelectionTypeCell="Range" AllowClipboardOperations="Copy" CopyFieldLabelsToClipboard="True" 
SelectionTypeRecord="Extended"
 ...../>
</igDP:XamDataGrid.FieldLayoutSettings>

Any suggestions on this topic?

best regards,

Tomas

Parents Reply Children