[Mono-list] DllImport ... help
Richard Torkar
richard.torkar@htu.se
15 Jun 2002 17:10:17 +0200
On Sat, 2002-06-15 at 16:32, Jonathan Pryor wrote:
> An MSDN sample might be worth looking at:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconbufferssample.asp
>
> It works for me on .NET, but I haven't been able to make it work with
> mono... I'm thinking that mono isn't ready for full-blown DllImport
> yet.
>
> For example, the following works with .NET
</snip>
> When I run either `managed.exe' (the mcs-compiled program) or
> `managed-net.exe' (the csc-compiled program) under .NET, I get the
> expected output:
>
> name: This is my message. Isn't it nice?
>
> When I run either `managed.exe' or `managed-net.exe' under mono, I get
> errors:
>
> name:
> ** (process:13403): WARNING **: unhandled exception
> System.NullReferenceException: "A null value was found where an object
> instance was required"
> in <0x00065> .ghbn:Main ()
>
> RESULT: -1
>
> This implies to me that Mono does not properly handle PInvoke calls, at
> least currently. (CVS tree built around 9:00 AM this morning).
>
Confirmed with release 0.12
/Richard
--
Supporting the Mono project, and helping you...
http://mono.baselabs.org http://mono.baselabs.org/CSAM
*** ***
"First steps" building guides, CSAM the C Sharp Archived Modules
daily Mono RPMS, C# tutorial,...