[Mono-winforms-list] DataGrid ctor: OutOfMemoryException

Maurice Michalski moscht at gmx.de
Sun Dec 3 10:03:58 EST 2006


Hi,

with Mono 1.2.1 (using Windows XP), I tried to create a DataGrid control. My
code looks like this:

public Form1() {
     DataGrid grd = new DataGrid();

     ((System.ComponentModel.ISupportInitialize)(grd)).BeginInit();
     this.Controls.Add(grd);
     ((System.ComponentModel.ISupportInitialize)(grd)).EndInit();
}

The following exception is thrown when the program is started with "mono
myapp.exe" (executing the program with MS.NET does not cause any errors):

---
Unhandled Exception: System.OutOfMemoryException: Out of memory.
  at System.Drawing.GDIPlus.CheckStatus (Status status) [0x00000]
  at System.Drawing.Graphics.DrawImage (System.Drawing.Image image,
Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight,
GraphicsUnit srcUnit, System.Drawing.Imaging.ImageAttributes imageAttr)
[0x00000]
  at (wrapper remoting-invoke-with-check) System.Drawing.Graphics:DrawImage
(System.Drawing.Image,System.Drawing.Rectangle,int,int,int,int,System.Drawing.GraphicsUnit,System.Drawing.Imaging.ImageAttributes)
  at System.Drawing.Bitmap.MakeTransparent (Color transparentColor)
[0x00000]
  at (wrapper remoting-invoke-with-check)
System.Drawing.Bitmap:MakeTransparent(System.Drawing.Color)
  at System.Windows.Forms.DataGrid..ctor () [0x00000]
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.DataGrid:.ctor ()

  at myapp.UI.frmMain..ctor () [0x00000]
  at (wrapper remoting-invoke-with-check) myapp.UI.frmMain:.ctor ()
  at myapp.Program.Main () [0x00000]
---

Other controls like textboxes, combos, labels, listviews, etc. are working
with Mono without any error.
The code's compiled without errors with mcs. Does anybody know what I am
doing wrong? :)

Regards,
Maurice

-- 
View this message in context: http://www.nabble.com/DataGrid-ctor%3A-OutOfMemoryException-tf2746878.html#a7663672
Sent from the Mono - WinForms mailing list archive at Nabble.com.



More information about the Mono-winforms-list mailing list