[Mono-bugs] [Bug 60004][Wis] New - Cannot open windows.forms application.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 11 Jun 2004 07:32:19 -0400 (EDT)


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 geert.audenaert@pandora.be.

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

--- shadow/60004	2004-06-11 07:32:19.000000000 -0400
+++ shadow/60004.tmp.30931	2004-06-11 07:32:19.000000000 -0400
@@ -0,0 +1,164 @@
+Bug#: 60004
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 2000 & XP
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Drawing.
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: Geert.Audenaert@Pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Cannot open windows.forms application. 
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+I hace created a simple windows.forms app with one button which shows a 
+messagebox. Works fine with the .net framework, but when starting the 
+executable with mono i get the following output:
+
+C:\Documents and Settings\audenag\My Documents\Visual Studio 
+Projects\simpleform
+\bin\Debug>mono simpleform.exe
+
+Unhandled Exception: System.EntryPointNotFoundException: GetDC
+in <0x00050> (wrapper managed-to-native) System.Drawing.GDIPlus:GetDC 
+(intptr)
+in <0x000e3> System.Drawing.Font:FromHfont (intptr)
+in <0x00015> System.Windows.Forms.Control:get_DefaultFont ()
+in <0x0018a> System.Windows.Forms.Control:.ctor ()
+in <0x00010> System.Windows.Forms.ScrollableControl:.ctor ()
+in <0x00012> System.Windows.Forms.ContainerControl:.ctor ()
+in <0x00016> System.Windows.Forms.Form:.ctor ()
+in <0x00017> simpleform.Form1:.ctor ()
+in <0x0004c> (wrapper remoting-invoke-with-check) simpleform.Form1:.ctor ()
+in <0x0001b> simpleform.Form1:Main ()
+
+I also compiled my source with the Mono C# compiler and that resulted in 
+exact the same problem.
+
+SourceCode:
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+
+namespace simpleform
+{
+	/// <summary>
+	/// Summary description for Form1.
+	/// </summary>
+	public class Form1 : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Button button1;
+		/// <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()
+		{
+			this.button1 = new System.Windows.Forms.Button();
+			this.SuspendLayout();
+			// 
+			// button1
+			// 
+			this.button1.Location = new System.Drawing.Point
+(48, 80);
+			this.button1.Name = "button1";
+			this.button1.Size = new System.Drawing.Size(184, 
+88);
+			this.button1.TabIndex = 0;
+			this.button1.Text = "button1";
+			this.button1.Click += new System.EventHandler
+(this.button1_Click);
+			// 
+			// Form1
+			// 
+			this.AutoScaleBaseSize = new System.Drawing.Size
+(5, 13);
+			this.ClientSize = new System.Drawing.Size(292, 
+273);
+			this.Controls.Add(this.button1);
+			this.Name = "Form1";
+			this.Text = "Form1";
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		/// <summary>
+		/// The main entry point for the application.
+		/// </summary>
+		[STAThread]
+		static void Main() 
+		{
+			Application.Run(new Form1());
+		}
+
+		private void button1_Click(object sender, System.EventArgs 
+e)
+		{
+			MessageBox.Show("Hello World");
+		}
+	}
+}
+
+
+
+Steps to reproduce the problem:
+1. Compile the source code above
+2. Run the executable with mono
+3. See the error
+
+Actual Results:
+
+
+Expected Results:
+
+
+How often does this happen? 
+
+
+Additional Information: