[Mono-winforms-list] WinForms not working with simple programs

Wayne Jensen wayne@dogpoop.cjb.net
Wed, 28 Jan 2004 00:51:07 -0700

The answer to my question is probably "RTFM"... but if it is, *please* 
point me toward a manual that explains this.  I've been searching for 
hours and can't find an answer.

I installed Mono from CVS and set up wine, following the instructions on 
the Mono web site.  I successfully compiled a simple WinForms app using 
mcs (one that I had previously run on .NET), then tried to run it with 
Mono and had strange things happened.  I got errors saying
"err:menu:MENU_GetSysMenu failed to load system menu!"
a blank form was displayed, and a box popped up on top of that form that 

"The application has produced an exception.  Press 'continue' if you 
want the application to try to continue its execution.
An exception was thrown by the type initializer for System.Drawing.GDIPlus"

This box had three buttons (which appear to be blank until I click on 
them): Stack Trace, Continue, Quit.  Clicking "Stack Trace" causes the 
message "Control notification Code 0 Id = Hwnd 65595" to appear in the 
console.  Clicking "Close" makes the form and the popup box go away, but 
the app is still running in the console.  Clicking "Continue" makes the 
popup go away, and another one appears saying "GdipCreateFromHDC" and 
these messages appear in the console:

"err:menu:MENU_CopySysPopup Unable to load default system menu
err:menu:MENU_GetSysMenu failed to load system menu!
err:menu:MENU_CopySysPopup Unable to load default system menu
err:menu:MENU_GetSysMenu failed to load system menu!"

After hours of searching, the only thing I could think is that I was 
using features that weren't implemented, so I downloaded this example 
from the Mono wiki:


It did the same thing, except that instead of a blank form it had the 
text boxes as shown in the screen shots (same error messages, same popup 
on top of the form).

My system:
Red Hat Fedora Core 1
AMD Athlon XP
Mono from CVS
Wine from rpm mono-wine-20030318-1.ximian.6.1.i386.rpm

BTW, I'm able to run console "Hello World" apps just fine, but when I 
try Gtk# or Gnome# apps I get "Unhandled Exception: 
System.DllNotFoundException: libgtk-win32-2.0-0.dll" and "Unhandled 
Exception: System.DllNotFoundException: libgobject-2.0-0.dll"  I know 
this problem is OT for this list, but I just thought I'd include it just 
in case the problems were related.  When I tried fixing this, the only 
information I found said it was problems with /etc/mono/config, but I 
checked mine and it matches what the other postings I read said it 
should be.

Thanks in advance,