[Mono-winforms-list] Still can't get winforms to work

Paul paul@all-the-johnsons.co.uk
Tue, 28 Sep 2004 23:21:51 +0100

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable


> Have you followed the instructions to build the managed windows forms
> found here: http://www.mono-project.com/contributing/winforms.html ?
> By default the old System.Windows.Forms.dll is built. You need to follow
> those instructions to build the new System.Windows.Forms.

Followed it to the letter.

This box has never had mono on and was built fresh from cvs.

I've looked in /usr/local/lib/mono and the symlink for SWF points
to /usr/lib/mono/gac rather than /usr/local/lib/mono/gac. If I correct
this to point to /usr/local/lib/mono/gac, SWF programs still don't work.

Here's the code I'm trying to run

// created on 26/06/2004 at 21:01

using System;
using System.Drawing;
using System.Windows.Forms;
public class TestTextBox : Form {
 TextBox tb =3D new TextBox();
 TextBox tb2 =3D new TextBox();
 public static void Main() {
  Application.Run(new TestTextBox());
 TestTextBox() {
  // some form text.
  Text =3D "Textbox test";
  // label
  Label l =3D new Label();
  l.Size =3D new Size(300, 16);
  l.Text =3D "Give me your name please:";
  l.Parent =3D this;
  l.Location =3D new Point(1,10);
  // textbox
  tb.Location =3D new Point(1,30);
  tb.MaxLength =3D 100;
  tb.Size =3D new Size(200,16);
  tb.Parent =3D this;
  // textbox
  tb2.Location =3D new Point(1,50);
  tb2.MaxLength =3D 100;
  tb2.Size =3D new Size(200,16);
  tb2.Parent =3D this; =20
  // Button
  Button b =3D new Button();
  b.Location =3D new Point(1,70);
  b.Text =3D "Press me";
  b.Parent =3D this;
  b.Click +=3D new EventHandler(ButtonOnClick);
 void ButtonOnClick(object obj, EventArgs ea) {
  tb2.Text =3D tb.Text;
} =20

Which compiles happily and then gives when trying to run...

Unhandled Exception: System.TypeInitializationException: An exception
was thrown by the type initializer for System.Windows.Forms.Control --->
System.TypeInitializationException: An exception was thrown by the type
initializer for System.Windows.Forms.Win32 --->
System.DllNotFoundException: winelib.exe.so
in <0x00050> (wrapper managed-to-native)
System.Windows.Forms.Win32:WineLoadLibrary (string)
in <0x00390> System.Windows.Forms.Win32:.cctor ()
--- End of inner exception stack trace ---

in (unmanaged) System.Windows.Forms.Control:.cctor ()
in <0x000f1> System.Windows.Forms.Control:.cctor ()
--- End of inner exception stack trace ---

in (unmanaged) System.Windows.Forms.TextBoxBase:.ctor ()
in <0x00011> System.Windows.Forms.TextBoxBase:.ctor ()
in <0x0000c> System.Windows.Forms.TextBox:.ctor ()
in <0x0004a> (wrapper remoting-invoke-with-check)
System.Windows.Forms.TextBox:.ctor ()
in <0x00035> TestTextBox:.ctor ()
in <0x0004a> (wrapper remoting-invoke-with-check) TestTextBox:.ctor ()
in <0x0001a> TestTextBox:Main ()

Something is still making it want to link to winelib.



Homer: Donut?=20
Lisa: No, thanks. Do you have any fruit?=20
Homer: This has purple stuff inside. Purple is a fruit.

Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.2.6 (GNU/Linux)