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

Peter Dennis Bartok peter@novonyx.com
Tue, 28 Sep 2004 17:00:06 -0600

It's not even using the right System.Windows.Forms.dll . The managed version 
does not have TextBox code *at all*. Not even stubbed. You are clearly 
running the old dll.


-----Original Message-----
From: "Paul" <paul@all-the-johnsons.co.uk>
To: "winforms" <mono-winforms-list@lists.ximian.com>
Date: 28 September, 2004 16:22
Subject: Re: [Mono-winforms-list] Still can't get winforms to work


> 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 = new TextBox();
TextBox tb2 = new TextBox();

public static void Main() {

  Application.Run(new TestTextBox());


TestTextBox() {

  // some form text.
  Text = "Textbox test";

  // label
  Label l = new Label();
  l.Size = new Size(300, 16);
  l.Text = "Give me your name please:";
  l.Parent = this;
  l.Location = new Point(1,10);

  // textbox
  tb.Location = new Point(1,30);
  tb.MaxLength = 100;
  tb.Size = new Size(200,16);
  tb.Parent = this;

  // textbox
  tb2.Location = new Point(1,50);
  tb2.MaxLength = 100;
  tb2.Size = new Size(200,16);
  tb2.Parent = this;

  // Button
  Button b = new Button();
  b.Location = new Point(1,70);
  b.Text = "Press me";
  b.Parent = this;
  b.Click += new EventHandler(ButtonOnClick);


void ButtonOnClick(object obj, EventArgs ea) {

  tb2.Text = tb.Text;

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?
Lisa: No, thanks. Do you have any fruit?
Homer: This has purple stuff inside. Purple is a fruit.