[Mono-bugs] [Bug 78612][Min] New - Crash when pasting from Clipboard into a Winforms textbox

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jun 28 11:59:21 EDT 2006

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by peter at novonyx.com.


--- shadow/78612	2006-06-28 11:59:21.000000000 -0400
+++ shadow/78612.tmp.23868	2006-06-28 11:59:21.000000000 -0400
@@ -0,0 +1,104 @@
+Bug#: 78612
+Product: Mono: Class Libraries
+Version: 1.1
+OS: unknown
+OS Details: Fedora Core 5
+Status: REOPENED   
+Severity: Unknown
+Priority: Minor
+Component: Windows.Forms
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: kiere at stylecrafthomes.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Crash when pasting from Clipboard into a Winforms textbox
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+I wrote a program that lets the user type, paste or load a text file into a
+text box.  When I copy something from a text editor like gEdit or
+OpenOffice.org Writer and paste it into my text box, I get a
+To verify that it was my program, I wrote a simple form with only one
+textbox on it and it did the same thing.  I am developing on Windows using
+Visual Studio 2005 (but writing the code for the .NET Framework 1.1) and I
+want the program to be cross-platform.  I am going to try to write the same
+program in MonoDevelop on Linux using Windows.Forms and see if it still
+happens (in case VS2005 is doing something quirky).
+Steps to reproduce the problem:
+1. Create a Windows Form with a textbox on it.
+2. Run the program
+3. Copy text from another Linux program (like gEdit or Writer)
+4. Paste the text into your Windows Forms textbox
+Actual Results:
+Unhandled Exception: System.InvalidCastException: Cannot cast from source
+type to destination type.
+in <0x001a1> System.Windows.Forms.XplatUIX11:ClipboardAvailableFormats
+(IntPtr handle)
+in <0x00015> System.Windows.Forms.XplatUI:ClipboardAvailableFormats (IntPtr
+in <0x0006a> System.Windows.Forms.Clipboard:GetDataObject ()
+in <0x0001c> System.Windows.Forms.TextBoxBase:Paste
+(System.Windows.Forms.Format format, Boolean obey_length)
+in <0x0013c> System.Windows.Forms.TextBoxBase:ProcessKey (Keys keyData)
+in <0x0014f> System.Windows.Forms.TextBoxBase:WndProc
+(System.Windows.Forms.Message m)
+in <0x0000d> System.Windows.Forms.TextBox:WndProc
+(System.Windows.Forms.Message m)
+in <0x00014> System.Windows.Forms.Control+ControlNativeWindow:WndProc
+(System.Windows.Forms.Message m)
+in <0x0011e> System.Windows.Forms.NativeWindow:WndProc (IntPtr hWnd, Msg
+msg, IntPtr wParam, IntPtr lParam)
+in <0x00016> System.Windows.Forms.XplatUIX11:DispatchMessage
+(System.Windows.Forms.MSG msg)
+in <0x00015> System.Windows.Forms.XplatUI:DispatchMessage
+(System.Windows.Forms.MSG msg)
+in <0x0061d> System.Windows.Forms.Application:RunLoop (Boolean Modal,
+System.Windows.Forms.ApplicationContext context)
+in <0x00024> System.Windows.Forms.Application:Run
+(System.Windows.Forms.Form mainForm)
+in <0x0002c> ClipboardErrorTest.Program:Main ()
+Expected Results:
+Text would appear in the textbox
+How often does this happen? 
+Every time.
+Additional Information:
+------- Additional Comments From kiere at stylecrafthomes.com  2006-06-08 15:53 -------
+Created an attachment (id=17161)
+Quick MonoDevelop project to test this problem
+------- Additional Comments From kiere at stylecrafthomes.com  2006-06-08 15:56 -------
+I copied a sample Windows Form project and removed all the "junk" that
+I could from it.  I ran the debugger and it compiled.  I ran the
+program and pasted something into it and it crashed.
+I hope this helps.  Give it a try and fix any coding mistakes to make
+it a more proper Mono example if need be.  If this is something I am
+doing wrong, please let me know at the e-mail address that I submitted.
+- Kiere
+------- Additional Comments From vargaz at gmail.com  2006-06-08 16:27 -------
+-> MWF
+------- Additional Comments From jackson at ximian.com  2006-06-12 20:11 -------
+Hi Kiere, I am not able to duplicate this crash here, which version of
+MWF are you using?

More information about the mono-bugs mailing list