[Mono-winforms-list] Fwd: Object reference not set to an instance of an object at System.Windows.Forms.XEventQueue+PaintQueue.Dequeue ()

Joao Rodrigues jpr.xarevision at gmail.com
Sun Feb 27 18:25:54 EST 2011


Hi Andy,
Thanks for the heads up. I'll have a look and try to figure out if that
is happenning.

Can calling  Invalidate() or hide() count as cross-thread???

Today I was trying to hack a solution: to try to catch the error,
wrapping Application.run() in a try/catch and enclose everything in a
while (true).

This made my aplication stay running, but all events are now "dead", and
the exception keeps poping up repeatly.

My understanding of what going on is very poor. But I think for this
"hack" to work i need to clear the UI messageloop, or the problem
message is still there,  but I can't seem to figure out how.

I this way viable in "hiding" the problem????


Thanks in advance.


On Sun, 2011-02-27 at 19:35 +0000, Andy Hume wrote:
> I haven't looked in detail, but my guess would be that your app has a
> thread that is accessing Forms control(s) directly.  Of course, only the
> UI thread is allowed to do that.
>
> Why do I think this?  Well the second error suggests that whilst the
> message loop in the UI thread is running, its list of items is being
> changed.  So it's likely that another thread is doing that.
>
> Andy
>
>
> > -----Original Message-----
> > From: mono-winforms-list-bounces at lists.ximian.com
> > [mailto:mono-winforms-list-bounces at lists.ximian.com] On
> > Behalf Of Joao Paulo Rodrigues
> > Sent: 26 February 2011 17:24
> > To: mono-winforms-list at lists.ximian.com
> > Subject: [Mono-winforms-list] Object reference not set to an
> > instance of an object at
> > System.Windows.Forms.XEventQueue+PaintQueue.Dequeue ()
> >
> >
> > Hi All
> >
> > I'm trying to port a C# application to MONO at Linux.
> >
> > All is working now (better than in windows) except for the
> > ocasional crash
> > at: System.Windows.Forms.XEventQueue+PaintQueue.Dequeue () .
> >
> > (Complete Stack trace bellow).
> >
> > The nature of the application makes this a terrible problem,
> > because the error is only catchable outside of the form (main
> > thread), so I have no option but to terminate the aplication.
> >
> > Can't figure out what the cause can be. All reports of this
> > on the Internet appear has bugs, with no corrections indicated.
> >
> > Can anyone help?
> >
> > I'm running Ubuntu 10.04 kernel 2.6.32-28 and Mono 2.6.7-3
> > ubuntu1~dh from badgerPorts
> >
> >
> > Thanks in advance for any help.
> >
> >
> > Program Error:Object reference not set to an instance of an object
> >
> >   at System.Windows.Forms.XEventQueue+PaintQueue.Dequeue ()
> > [0x00000] in <filename unknown>:0
> >   at System.Windows.Forms.XplatUIX11.GetMessage
> > (System.Object queue_id, System.Windows.Forms.MSG& msg,
> > IntPtr handle, Int32 wFilterMin, Int32
> > wFilterMax) [0x00000] in <filename unknown>:0
> >   at System.Windows.Forms.XplatUI.GetMessage (System.Object
> > queue_id, System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32
> > wFilterMin, Int32
> > wFilterMax) [0x00000] in <filename unknown>:0
> >   at System.Windows.Forms.Application.RunLoop (Boolean Modal,
> > System.Windows.Forms.ApplicationContext context) [0x00000] in
> > <filename
> > unknown>:0
> >   at System.Windows.Forms.Application.Run
> > (System.Windows.Forms.ApplicationContext context) [0x00000]
> > in <filename
> > unknown>:0
> >   at System.Windows.Forms.Application.Run (System.Windows.Forms.Form
> > mainForm) [0x00000] in <filename unknown>:0
> >   at Xarevision.Program.Main () [0x00000] in <filename unknown>:0
> >
> > or
> >
> >
> > Program Error:List has changed.
> >
> >   at System.Collections.ArrayList+SimpleEnumerator.MoveNext
> > () [0x00000] in <filename unknown>:0
> >   at System.Windows.Forms.XEventQueue+PaintQueue.Dequeue ()
> > [0x00000] in <filename unknown>:0
> >   at System.Windows.Forms.XplatUIX11.GetMessage
> > (System.Object queue_id, System.Windows.Forms.MSG& msg,
> > IntPtr handle, Int32 wFilterMin, Int32
> > wFilterMax) [0x00000] in <filename unknown>:0
> >   at System.Windows.Forms.XplatUI.GetMessage (System.Object
> > queue_id, System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32
> > wFilterMin, Int32
> > wFilterMax) [0x00000] in <filename unknown>:0
> >   at System.Windows.Forms.Application.RunLoop (Boolean Modal,
> > System.Windows.Forms.ApplicationContext context) [0x00000] in
> > <filename
> > unknown>:0
> >   at System.Windows.Forms.Application.Run
> > (System.Windows.Forms.ApplicationContext context) [0x00000]
> > in <filename
> > unknown>:0
> >   at System.Windows.Forms.Application.Run (System.Windows.Forms.Form
> > mainForm) [0x00000] in <filename unknown>:0
> >   at Xarevision.Program.Main () [0x00000] in <filename unknown>:0
> >
> >
> > __________________________________________________
> > João Paulo Rodrigues
> >
> > XAREVISION Lda.      Url: www.xarevision.pt
> >
> > R. Dr Roberto Frias 378  E-mail: jpr at xarevision.pt
> > 4200 - 465 Porto         Tel.:   + 351 22 2094065
> >                          Mobile: + 351 93 3206764
> >                      Fax:    + 351 22 2094246
> >
> >
> > _______________________________________________
> > Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20110227/34b6ffe6/attachment.html 


More information about the Mono-winforms-list mailing list