[Mono-bugs] [Bug 80793][Blo] New - Forms with menus do not work

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Feb 11 15:08:54 EST 2007

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 georgegiolfan at yahoo.com.


--- shadow/80793	2007-02-11 15:08:53.000000000 -0500
+++ shadow/80793.tmp.23813	2007-02-11 15:08:54.000000000 -0500
@@ -0,0 +1,42 @@
+Bug#: 80793
+Product: Mono: Class Libraries
+Version: 1.0
+OS: Windows XP
+OS Details: 
+Status: NEW   
+Priority: Blocker
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: georgegiolfan at yahoo.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Forms with menus do not work
+Steps to reproduce the problem:
+Compile and run the following program.
+using System.Windows.Forms;
+class Test {
+    static void Main() {
+        Form f = new Form();
+        f.Menu = new MainMenu();
+        Application.Run(f);
+    }
+Actual Results:
+NullReferenceException in XplatUIWin32.PaintEventStart, in the line
+hwnd.drawing_stack.Push (hdc);
+in the else block, caused by Hwnd.windows not containing at that time the 
+Hwnd for the handle.
+PaintEventStart is called from Form.WndProc, handling WM_NCPAINT.
+WndProc is called from XplatUIWin32.CreateWindow, in the Win32CreateWindow 
+call, before the line
+hwnd.ClientWindow = WindowHandle;
+which adds the Hwnd to Hwnd.windows.
+How often does this happen? 
+Always, on the SVN version.

More information about the mono-bugs mailing list