[Mono-bugs] [Bug 42569][Nor] Changed - Mono does not properly marshal P/Invoke return type

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Thu, 8 May 2003 06:18:17 -0400 (EDT)


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 dietmar@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=42569

--- shadow/42569	Thu May  8 02:55:26 2003
+++ shadow/42569.tmp.16656	Thu May  8 06:18:17 2003
@@ -1,14 +1,14 @@
 Bug#: 42569
 Product: Mono/Runtime
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
-Status: NEW   
+Status: ASSIGNED   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: mathpup@mylinuxisp.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -64,7 +64,30 @@
 Test case
 
 
 ------- Additional Comments From mathpup@mylinuxisp.com  2003-05-08 02:55 -------
 Created an attachment (id=4234)
 Test case
+
+
+------- Additional Comments From dietmar@ximian.com  2003-05-08 06:18 -------
+We currently do not support conversion of reference types. But you can
+simple use a struct instead of a class:
+
+[StructLayout(LayoutKind.Explicit, Size=8)]
+internal struct VectorList
+{
+    [FieldOffset(0)] internal int a;
+    [FieldOffset(4)] internal int b;
+}
+
+and in C++ return the struct by value:
+
+VectorList getVectorList(x_Button* ptr)
+{
+    cout << "C++ getVectorList() returns " << &(ptr->vectorList) << endl;
+    return ptr->vectorList;
+}
+
+
+