[Mono-bugs] [Bug 75732][Nor] New - null ref exception

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Aug 6 12:08:51 EDT 2005


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

http://bugzilla.ximian.com/show_bug.cgi?id=75732

--- shadow/75732	2005-08-06 12:08:51.000000000 -0400
+++ shadow/75732.tmp.4103	2005-08-06 12:08:51.000000000 -0400
@@ -0,0 +1,149 @@
+Bug#: 75732
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Drawing.
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: smeegoan at yahoo.com.br               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: null ref exception
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+
+Steps to reproduce the problem:
+1. compile the following code
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+
+namespace WindowsApplication1
+{
+	/// <summary>
+	/// Summary description for Form1.
+	/// </summary>
+	public class Form1 : System.Windows.Forms.Form
+	{
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public Form1()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if (components != null) 
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			// 
+			// Form1
+			// 
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.ClientSize = new System.Drawing.Size(292, 269);
+			this.Name = "Form1";
+			this.Text = "Form1";
+			this.Load += new System.EventHandler(this.Form1_Load);
+
+		}
+		#endregion
+
+		/// <summary>
+		/// The main entry point for the application.
+		/// </summary>
+		[STAThread]
+		static void Main() 
+		{
+			Application.Run(new Form1());
+		}
+
+		private void Form1_Load(object sender, System.EventArgs e)
+		{
+			System.Drawing.Font oFont;
+			oFont = new System.Drawing.Font(Parent.Font.Name, Parent.Font.Size,
+FontStyle.Regular);
+
+		}
+	}
+}
+
+2. run with mono
+3. the application crashes
+
+Actual Results:
+
+C:\Documents and Settings\Pedro>mono "C:\Documents and Settings\Pedro\My
+Documen
+ts\Visual Studio
+Projects\WindowsApplication1\bin\Debug\WindowsApplication1.exe"
+
+Mono System.Windows.Forms Assembly [Revision: 44786; built: 2005/5/25 22:34:45]
+
+Unhandled Exception: System.NullReferenceException: Object reference not set to
+an instance of an object
+in <0x0001e> WindowsApplication1.Form1:Form1_Load (System.Object sender,
+System.
+EventArgs e)
+in (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_object_EventAr
+gs (object,System.EventArgs)
+in <0x00023> System.Windows.Forms.Form:OnLoad (System.EventArgs e)
+in <0x000b5> System.Windows.Forms.Form:OnCreateControl ()
+in <0x00045> System.Windows.Forms.Control:CreateControl ()
+in (wrapper remoting-invoke-with-check)
+System.Windows.Forms.Control:CreateContr
+ol ()
+in <0x0000e> System.Windows.Forms.Application:Run
+(System.Windows.Forms.Form mai
+nForm)
+in <0x00021> WindowsApplication1.Form1:Main ()
+
+
+
+Expected Results:
+create the font with the specified properties
+
+How often does this happen? 
+always
+
+Additional Information:


More information about the mono-bugs mailing list