I ran my Delphi-prism (.NET) program on Linux under Mono. It ran for awhile and crashed with the following error message on the terminal. But the same program runs perfectly fine on Windows 7
Can anyone tell me why?
Unhandled Exception: System.NullReferenceException: 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 Millennia.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
It looks like your program is using Windows Forms. Support for Windows Forms is not the best in mono. Mono provides the runtime and libraries, but if you want to make a cross-platform program you need to consider the UI libraries you make use of as well.
Update (2016):
My original answer is probably wrong. According to this page, support for Windows Forms 2.0 is complete, but there may still be a number of bugs, I haven't tried it. However if you use a third-party UI library, for example Infragistics, they probably won't work due to native calls.
Have a look at this page for more info on porting Winforms apps, including the tool MoMA that can help.