[Mono-list] Strange exception in Winforms app

Stifu stifu at free.fr
Tue Apr 29 12:08:02 UTC 2014


Hi,

I wish WinForms was more usable in general, but yeah, that's how it is.
People will recommend you stay away from WinForms because it's old and badly
supported in Mono.

That said, WinForms is maintained by the community now, so if we want to
make it better, it's in our hands. If you feel the motivation to fix that
bug, I can review your patch and commit it.

If that app is only unusable due to that one specific WinForms bug, it could
be worth fixing it, rather than try to port the whole app to another GUI
toolkit, which may not be a realistic solution.


baltasarq wrote
> Hi, there,
> 
> 	I'm using Mono 3.2.8 in Lubuntu 14.04, and I'm observing an odd behaviour
> which renders a WinForms app unusable. This application works perfectly in
> Windows, I mean, with the .NET stack, and worked perfectly in the previous
> version of Lubuntu (with an older version of Mono).
> 
> 	http://baltasarq.info/dev/pgcal/
> 
> 	The app has a DataGridView. The problem is that, the second time you try
> to write something in a cell, WinForms launches the following exception
> (below). After this exception, the second time you write in the
> datagridview cell, the exception is raised continuously, so you actually
> cannot use the app.
> 
> 	Any hint?	
> 	Is this problem known?
> 
> 	EDIT: Oh, well, bad news. Yep, the problem is "known" (though nobody
> seems to care). User djdjaa89 reported it in bugzilla on January 1st,
> 2013, and had no answer.
> 
> 	http://bugzilla.xamarin.com/show_bug.cgi?id=9653
> 
> 	I guess what the "answer" to this e.mail is going to be.
> 
> ==
> $ mono ../pgcal/pgcal/bin/Release/pgcal.exe 
> System.ObjectDisposedException: The object was used after being disposed.
>   at System.Windows.Forms.Control.CreateHandle () [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.TextBoxBase.CreateHandle () [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control.CreateControl () [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control.SetVisibleCore (Boolean value) [0x00000]
> in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control.set_Visible (Boolean value) [0x00000] in 
> <filename unknown>
> :0 
>   at (wrapper remoting-invoke-with-check)
> System.Windows.Forms.Control:set_Visible (bool)
>   at System.Windows.Forms.DataGridView.BeginEdit (Boolean selectAll)
> [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.DataGridView.ProcessKeyEventArgs
> (System.Windows.Forms.Message& m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control.ProcessKeyMessage
> (System.Windows.Forms.Message& m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control.WmKeys (System.Windows.Forms.Message& m)
> [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&
> m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.DataGridView.WndProc
> (System.Windows.Forms.Message& m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
> (System.Windows.Forms.Message& m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control+ControlNativeWindow.WndProc
> (System.Windows.Forms.Message& m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg,
> IntPtr wParam, IntPtr lParam) [0x00000] in 
> <filename unknown>
> :0 
> System.ObjectDisposedException: The object was used after being disposed.
>   at System.Windows.Forms.Control.CreateHandle () [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.TextBoxBase.CreateHandle () [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control.get_Handle () [0x00000] in 
> <filename unknown>
> :0 
>   at (wrapper remoting-invoke-with-check)
> System.Windows.Forms.Control:get_Handle ()
>   at System.Windows.Forms.DataGridView.ProcessKeyEventArgs
> (System.Windows.Forms.Message& m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control.ProcessKeyMessage
> (System.Windows.Forms.Message& m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control.WmKeys (System.Windows.Forms.Message& m)
> [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&
> m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.DataGridView.WndProc
> (System.Windows.Forms.Message& m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
> (System.Windows.Forms.Message& m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.Control+ControlNativeWindow.WndProc
> (System.Windows.Forms.Message& m) [0x00000] in 
> <filename unknown>
> :0 
>   at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg,
> IntPtr wParam, IntPtr lParam) [0x00000] in 
> <filename unknown>
> :0
> ==
> 
> -- 
> Baltasar (

> baltasarq@

>   http://baltasarq.info/)
> _______________________________________________
> Mono-list maillist  -  

> Mono-list at .ximian

> http://lists.ximian.com/mailman/listinfo/mono-list





--
View this message in context: http://mono.1490590.n4.nabble.com/Strange-exception-in-Winforms-app-tp4662640p4662642.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list