[Mono-bugs] [Bug 322934] StructLayout for DateTime passed to managed code

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 6 18:09:51 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=322934

User tom_hindle at sil.org added comment
http://bugzilla.novell.com/show_bug.cgi?id=322934#c3





--- Comment #3 from tom hindle <tom_hindle at sil.org>  2009-10-06 16:09:51 MDT ---
Expected result (from new test case): 

40153.000000

Actual result:
** ERROR **: Type System.DateTime which is passed to unmanaged code must have a
StructLayout attribute
aborting...

Or message box saying same thing on mono/Windows.


NET 

Seems to automatically marshal this value type to a native DATE.

Quote from DateTime page on MSDN:
"When only a time is passed from the .NET Framework to COM, special processing
is performed that converts the time to the format used by COM."


Switching DateTime from [StructLayout(LayoutKind.Auto)] to
[StructLayout(LayoutKind.Sequential)]

causes the result to on mono to be 0.0.

I think mono needs to handle this as a special case.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list