[Mono-winforms-list] System.Windows.Forms.Win32:WineLoadLibrary throws NullReferenceEx
ception for gdi32 (winelib.exe.so IS found)
Martin Tapp
tappm@cae.com
Fri, 17 Sep 2004 09:02:22 -0400
Hi,
I've installed wine and everything seems to work fine (notepad and all
work).
I'm unable to make any windows forms app running, even the sample provided
in mcs/class/System.Windows.Forms/Samples/Form1.exe fails. All compile,
winelib.exe.so is found,
but the line in
mcs/class/System.Windows.Forms/System.Windows.Forms/win32functions.cs:1430
WineLoadLibrary("gdi32.dll");
always throws a null reference exception. Any idea what is wrong?
Here is the output (I'm under Red Hat 9, Kernel 2.4.20, gcc 3.2.2, mono
snapshot 14-Sep-04:
[root@P3986 Samples]# mono --debug Form1.exe
Unhandled Exception: System.TypeInitializationException: An exception was
thrown by the type initializer for System.Windows.Forms.Control --->
System.TypeInitializationException: An exception was thrown by the type
initializer for System.Windows.Forms.Win32 --->
System.NullReferenceException: Object reference not set to an instance of an
object
in <0xd376ef> (wrapper managed-to-native)
System.Windows.Forms.Win32:WineLoadLibrary (string)
in <0x00004> (wrapper managed-to-native)
System.Windows.Forms.Win32:WineLoadLibrary (string)
in [0x0014b] (at
/data1/home/tappm/mono-14-Sep-04/mcs/class/System.Windows.Forms/System.Windo
ws.Forms/win32functions.cs:1430) System.Windows.Forms.Win32:.cctor ()
--- End of inner exception stack trace ---
in (unmanaged) System.Windows.Forms.Control:.cctor ()
in <0x000f1> System.Windows.Forms.Control:.cctor ()
--- End of inner exception stack trace ---
in (unmanaged) System.Windows.Forms.ScrollableControl:.ctor ()
in [0x00001] (at
/data1/home/tappm/mono-14-Sep-04/mcs/class/System.Windows.Forms/System.Windo
ws.Forms/ScrollableControl.cs:55)
System.Windows.Forms.ScrollableControl:.ctor ()
in [0x00001] (at
/data1/home/tappm/mono-14-Sep-04/mcs/class/System.Windows.Forms/System.Windo
ws.Forms/ContainerControl.cs:49) System.Windows.Forms.ContainerControl:.ctor
()
in [0x00008] (at
/data1/home/tappm/mono-14-Sep-04/mcs/class/System.Windows.Forms/System.Windo
ws.Forms/Form.cs:109) System.Windows.Forms.Form:.ctor ()
in <0x00017> WindowsApplication1.Form1:.ctor ()
in <0x0004a> (wrapper remoting-invoke-with-check)
WindowsApplication1.Form1:.ctor ()
in <0x0001a> WindowsApplication1.Form1:Main ()
Thanks!
Martin Tapp
Software Engineer
CAE Inc.