[Mono-devel-list] System.Windows.Froms on win32 platform

Peter Dennis Bartok peter at novonyx.com
Wed Sep 29 12:28:07 EDT 2004


Aleksandar,

Check out the attached email.Wine is no longer used for System.Windows.Forms 
and a new, managed implementation can be found in 
mcs/class/Managed.Windows.Forms.

Peter

-----Original Message-----
From: "Aleksandar Dezelin" <dezelin32 at fastmail.fm>
To: "Mono-devel-list" <mono-devel-list at lists.ximian.com>
Date: 29 September, 2004 01:48
Subject: [Mono-devel-list] System.Windows.Froms on win32 platform


>Hi,
>
>I'm just curious, does Mono use Wine to emulate System.Windows.Forms on
>win32? Is it possible to run a SWF application  under Mono on win32?
>When I try to run it I get the following exception dump:
>
>Unhandled Exception: System.ArgumentException: Invalid Parameter. A null
>referen
>ce or invalid value was found.
>in <0x00073> System.Drawing.GDIPlus:CheckStatus (System.Drawing.Status)
>in <0x00182> System.Drawing.Font:FromHfont (intptr)
>in <0x00015> System.Windows.Forms.Control:get_DefaultFont ()
>in <0x001af> 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 <0x0006c> Informatika.Infos.Foundation.WinClient.WinClientHost:.ctor
>()
>in <0x0004c> (wrapper remoting-invoke-with-check)
>Informatika.Infos.Foundation.W
>inClient.WinClientHost:.ctor ()
>in <0x0001b> Informatika.Infos.Foundation.WinClient.WinClientHost:Main
>()
>
>
>
>I think I've found figured it out. This is the problematic method:
>
>System\Drawing\Font.cs:
>
> public static Font FromHfont (IntPtr Hfont)
> {
> OperatingSystem osInfo = Environment.OSVersion;
> IntPtr newObject;
> IntPtr hdc;
> IntPtr oldFont;
> FontStyle newStyle = FontStyle.Regular;
> float newSize;
> LOGFONTA lf = new LOGFONTA ();
>
> // Sanity. Should we throw an exception?
> if (Hfont == IntPtr.Zero) {
> Font result = new Font ("Arial", (float)10.0, FontStyle.Regular);
> return(result);
> }
>
>Why internal method
>Environment.Platform returns 128
>as a PlatformID on Win32?
>OS isn't Unix!
>-------------------->   if ((int) osInfo.Platform == 128) {
> // If we're on Unix we use our private gdiplus API to avoid Wine
> // dependencies in S.D
>
> lock (typeof (Font))
> {
> Status s = GDIPlus.GdipCreateFontFromHfont (Hfont, out newObject, ref lf);
> GDIPlus.CheckStatus (s);
> }
> } else {
>
> // This needs testing
> // GetDC, SelectObject, ReleaseDC GetTextMetric and
> // GetFontFace are not really GDIPlus, see gdipFunctions.cs
>
> newStyle = FontStyle.Regular;
>
> lock (typeof (Font))
> {
> hdc = GDIPlus.GetDC (IntPtr.Zero);
> Font f = FromLogFont (lf, hdc);
> GDIPlus.ReleaseDC (hdc);
> return f;
> }
> }
>...
>
>
>Thanks in advance
>Aleksandar Dezelin
>-- 
>  Aleksandar Dezelin
>  dezelin32 at fastmail.fm
>
>_______________________________________________
>Mono-devel-list mailing list
>Mono-devel-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
> 
-------------- next part --------------
An embedded message was scrubbed...
From: "Peter Dennis Bartok" <peter at novonyx.com>
Subject: [Mono-winforms-list] System.Windows.Forms Status Update
Date: Thu, 9 Sep 2004 15:23:52 -0600
Size: 6467
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040929/e44b20be/attachment.eml 


More information about the Mono-devel-list mailing list