Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=81257 --- shadow/81257 2007-03-28 18:59:19.000000000 -0500 +++ shadow/81257.tmp.6759 2007-03-28 18:59:19.000000000 -0500 @@ -0,0 +1,85 @@ +Bug#: 81257 +Product: Mono: Runtime +Version: 1.1 +OS: +OS Details: Nokia N800 OS +Status: NEW +Resolution: +Severity: +Priority: Critical +Component: interop +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: problem using "double" type parameter to PInvoke on nokia N800 + +I find several bug in some method on Gtk# on maemo platform. In all this +method there is almost one parametro of "double" type. So I write a simple +.so library that print the passed value, and integer and a double, add this +value as return the sun as double. + +I try this .so in C program and work. I write a simple C# program and the +double parameter is always 0.0F. + +This code work fine on testing environment but not on real device. + +The output from the device is: + +INT: 5 +FLOAT: 0,000000 +RET: 5,000000 +Hello World! Ret=5 + +while the output that I must have will be: + +INT: 5 +FLOAT: 3,500000 +RET: 8,500000 +Hello World! Ret=8.5 + +P.S. sorry for my terrible english :( + +---------------------------------- C# Routine ------------------------ +using System; +using System.Runtime.InteropServices; + +namespace test_sotest +{ + class MainClass + { + + [DllImport ("sotest.so")] + private static extern double sotest_object_testfunc(int a, double b); + + public static void Main(string[] args) + { + int a=5; + double b=3.5f; + double ret=0f; + try { + ret=sotest_object_testfunc(a, b); + } catch (System.DllNotFoundException ex) { + Console.WriteLine("Shared Library Not Found."+ex.Message); + } + + Console.WriteLine("Hello World! Ret="+ret); + } + } +} +---------------------------------- C Library ------------------------- + +double sotest_object_testfunc(int a, double b) +{ + double ret; + + printf("INT: %i\n",a); + printf("FLOAT: %f\n",b); + + ret=b+a; + + printf("RET: %f\n",ret); + return ret; +} _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
