[Mono-list] how to get a handle to MonoImage ?? trying to call C# codefrom C

Manish Gupta GManish@novell.com
Tue, 10 Feb 2004 04:50:40 -0700

I was able to get it working. However, I faced a strange problem. I
created a test DLL with a method foo(). This method was doing some File
IO. Things worked fine when I invoked this method from C. 

NOW, I introduced Console.Writeline() statement in the function foo()
and the result of invoking foo from C was ...

Unhandled Exception: System.TypeInitializationException: An exception
was thrown by the type initializer for System.Console --->
System.NullReferenceException: A null value was found where an object
instance was required
in [0x00000] (at
System.Globalization.CultureInfo:get_CurrentCulture ()
in [0x00001] (at /cvs/mcs/class/corlib/System/String.cs:673)
System.String:ToUpper ()
in [0x00016] (at /cvs/mcs/class/corlib/System/Console.cs:32)
System.Console:.cctor ()
--- End of inner exception stack trace ---
in (unmanaged) System.Console:WriteLine (string)
in <0x00017> TestNamespace.test:foo (string)

Can somebody provide a clue?

>>> "Manish Gupta" <GManish@novell.com> 2/9/2004 5:20:27 PM >>>
I am writing a test program in C which can invoke methods in CIL
universe. Am following the instructions mentioned at

mono_class_from_name() expects a pointer to MonoImage as one of the
How do I get this reference and pass it on as a parameter to 

Is there any other documentation for mono embedding API?



Mono-list maillist  -  Mono-list@lists.ximian.com