We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Clipboard exception...

I tried to use the EditControl in my project but during the test of the interface when I pressed CTRL + C an interop exception was thrown saying "The requested clipboard operation failed" or something like that. And the CopyWithoutSelection property is set to ''false''.

13 Replies

AD Administrator Syncfusion Team April 6, 2004 03:14 PM UTC

Hi Iliyan We were unable to reproduce the problem you describe above. Can you post information on the Operating System and VS.NET version. Did you try setting the CopyWithoutSelection property to true and see if it makes a difference? Can you post steps to reproduce this consistently in say one of the Essential Edit samples so that we can take a look? Regards Arun


ML Marc Leblanc April 7, 2004 01:27 AM UTC

Hi Arun, I had similar problems many times. My app was running on Windows 2000, .Net 1.1 and use Syncfusion Essential Suite (Edit, Docking Manager, XPMenus and Grid) (version 1.5 to 2.0.3.0). In my case, the CopyWithoutSelection property is set to true. At first I think that the problem was du to the english version of Win2K. (My application is build on a french version of Win2K with Visual Studio 2003 English). But the installation of french language pack didn''t solve the problem. To temporary solve the problem I had to modify Essential Edit by enclosing calls to Clipboard with try/catch block. This workaround work as the Clipboard interop exception occurs after the copy take place. So just catching the exception is enough to make to CTRL-C work (at least for my app). Actually there''s two place where exception occurs: 1) In the Copy method, thrown by the Clipboard.SetDataObject(SelectedText, true) call; 2) In the CanPaste property, thrown by the Clipboard.GetDataObject() call. I hope this info can help. Marc


AD Administrator Syncfusion Team April 7, 2004 04:30 PM UTC

Hi Marc, Thanks for the update. We will try to reproduce this problem and take a look at your suggestion. Regards Arun


ZT Zubin Tiku December 10, 2004 05:01 PM UTC

I am currently developing a product using the EssentialGrid and am also experiencing an error regarding the clipboard, however it only seems to occur on certain machines and only when I try to copy large quantities of information (3000 rows by 13 columns) from the Grid into the clipboard. The affected machines are using EssentialGrid 2.0.5.0, and Windows 2000 5.0.2195 Service Pack 4, and .NET 1.1.4322. P.S. I am also using the Grid in Virtual Mode. The stack trace is as follows: System.Runtime.InteropServices.ExternalException: The requested clipboard operation failed. at System.Windows.Forms.Clipboard.SetDataObject(Object data, Boolean copy) at System.Windows.Forms.Clipboard.SetDataObject(Object data) at Syncfusion.Windows.Forms.Grid.GridModelCutPaste.CopyCellsToClipboard(GridRangeInfoList rangeList, Boolean bLoadBaseStyles) at Syncfusion.Windows.Forms.Grid.GridModelCutPaste.CopyRange(GridRangeInfoList rangeList) at Syncfusion.Windows.Forms.Grid.GridModelCutPaste.Copy() at Syncfusion.Windows.Forms.Grid.GridControlBase.OnKeyDown(KeyEventArgs e) at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m) at Syncfusion.Windows.Forms.Grid.GridControlBase.ProcessKeyEventArgs(Message& m) at System.Windows.Forms.Control.ProcessKeyMessage(Message& m) at Syncfusion.Windows.Forms.Grid.GridControlBase.ProcessKeyMessage(Message& m) at System.Windows.Forms.Control.WmKeyChar(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg) at Syncfusion.Windows.Forms.Grid.GridControlBase.WndProc(Message& msg) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


AD Administrator Syncfusion Team December 13, 2004 07:34 PM UTC

Hi Zubin It looks like you also sent an email to our Support team with reference to this problem. Kindly refer to support incident 15352 where the Grid Technical support team will interact with you on this issue. Regards Arun


AD Administrator Syncfusion Team May 26, 2005 01:10 PM UTC

So has this problem been fixed? Or if not what is the exact workaround to cathing the xceptions?


AD Administrator Syncfusion Team May 26, 2005 10:44 PM UTC

Hi Peterainbow, The v3.2 Edit does not have any such issues. All the clipboard operations work fine in this. Please let me know if you need any other information. Regards, Guru Patwal Syncfusion, Inc.


AD Administrator Syncfusion Team June 9, 2005 06:12 PM UTC

we are not in a position to be able to make that upgrade it seemed like there was a workaround from the previous mails, just wondered what it was and how to do it...


AD Administrator Syncfusion Team June 10, 2005 03:18 PM UTC

so i''ve managed to replace the menu item with my own version but still gets Ctrl.Insert calling into the broken syncfusion version How is ctrl.insert hooked into the menu, the accelerator on the orig menu is Ctrl.C and there doesn''t seem to be any key capture... So near and yet so many crashes....


AD Administrator Syncfusion Team June 14, 2005 12:10 PM UTC

Hi Guru I''m able to reproduce the problem: Start a RemoteDesktop session to a server/other XP client and start a an application that contains Essential Edit. At least the first time you''re copying something to the clipboard you''ll get an exception. Closing the RemoteDesktop session, the problem is away. Using the Clipboard.SetDataObject(data, false); does work all the time. Regards, Thomas


AD Administrator Syncfusion Team June 14, 2005 04:10 PM UTC

Hi Thomas and Peterainbow, I have tested for this issue in our latest internal build and do not see any such problems even while using remote desktop. Please create a Direct-Trac incident in this regard and I will update you with the download instructions for our latest internal build. You could then test your application in it and see if you can recreate this issue. We appreciate your cooperation. Regards, Guru Patwal Syncfusion, Inc.


AD Administrator Syncfusion Team June 14, 2005 04:55 PM UTC

Hi Guru The following conditions: - Windows XP SP2 - Start the Remote Desktop session first - Start the application that contains the Edit control und hit a CTRL+C It seams to be a problem of the .NET Framework when using the SetDataObject command. Regards, Thomas


AD Administrator Syncfusion Team July 5, 2005 03:59 PM UTC

Hi Thomas, I wish I had some more useful information for you. I have tested out your configuration with the new edit control and the legacy edit control, both worked fine for the Ctrl-C. However, I have in fact seen the issue that you are referring to previously, and in fact it would happen on any call to set the clipboard data on that particular machine (e.g. not related to Essential Edit - the call could be in any project). I do not know if you have the source code, but if you do, have you tried Marc''s workaround (mentioned above): "To temporary solve the problem I had to modify Essential Edit by enclosing calls to Clipboard with try/catch block. This workaround work as the Clipboard interop exception occurs after the copy take place. So just catching the exception is enough to make to CTRL-C work (at least for my app)."

Loader.
Live Chat Icon For mobile
Up arrow icon