[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


--=-kcbnAXkEmcRT++mqrQuq
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi,

> Have you followed the instructions to build the managed windows forms
> found here: http://www.mono-project.com/contributing/winforms.html ?
>=20
> 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;
=20
=20
public class TestTextBox : Form {
=20
 TextBox tb =3D new TextBox();
 TextBox tb2 =3D new TextBox();
=20
 public static void Main() {
=20
  Application.Run(new TestTextBox());
  =20
 }
=20
 TestTextBox() {
=20
  // some form text.
  Text =3D "Textbox test";
  =20
  // 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);
=20
  // textbox
  tb.Location =3D new Point(1,30);
  tb.MaxLength =3D 100;
  tb.Size =3D new Size(200,16);
  tb.Parent =3D this;
  =20
  // textbox
  tb2.Location =3D new Point(1,50);
  tb2.MaxLength =3D 100;
  tb2.Size =3D new Size(200,16);
  tb2.Parent =3D this; =20
  =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);
=20
 }
=20
 void ButtonOnClick(object obj, EventArgs ea) {
=20
  tb2.Text =3D tb.Text;
  MessageBox.Show(tb2.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.

TTFN

Paul

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

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQBBWeP+usSVe5EZv3wRAqreAKCSFIFPucSr3dD7ZxuwKFL0h+QfwACcCHnR
BZ3lYFVNp50USgAqY5m+Vvk=
=2SGp
-----END PGP SIGNATURE-----

--=-kcbnAXkEmcRT++mqrQuq--