[Mono-dev] SystemIcons.Exclamation produces an exception.

caz yokoyama caz at caztech.com
Sat Dec 2 11:56:15 EST 2006

Has anyone ever used SystemIcons.Exclamation? It produces an exception while
it works on Windows. Is this a bug or am I missing something?


------------ icon.cs ----------

using System;

using System.Drawing;

using System.Collections;

using System.Drawing.Imaging;

using System.Security.Cryptography;


class icon


            public static void Main () {

                        Icon aaa = new Icon(SystemIcons.Exclamation, 40,

                        Console.WriteLine("Hello World");




-------------- log ---------

[caz at localhost icon]$ mcs -debug  -r:System.Drawing.dll icon.cs

icon.cs(10,8): warning CS0219: The variable `aaa' is assigned but its value
is never used

Compilation succeeded - 1 warning(s)

[caz at localhost icon]$ mono --debug icon.exe


Unhandled Exception: System.NullReferenceException: Object reference not set
to an instance of an object

  at System.Drawing.Icon..ctor (System.Drawing.Icon original, Size size)
[0x0001f] in

  at System.Drawing.Icon..ctor (System.Drawing.Icon original, Int32 width,
Int32 height) [0x00000] in

  at (wrapper remoting-invoke-with-check) System.Drawing.Icon:.ctor

  at icon.Main () [0x00000] in /home/caz/umd/icon/icon.cs:10


- caz at caztech dot com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061202/38ee9bd8/attachment.html 

More information about the Mono-devel-list mailing list