Raja R Harinath wrote:
> Hi,
> 
> Robert Jordan <[EMAIL PROTECTED]> writes:
> 
>> FirstName LastName wrote:
>>> What would be the best equivalent unmanaged type (linux and windows)
>>> to use if I want to marshal a DateTime in the managed world (.NET,
>>> mono)?
>> You can't marshal DateTime directly because its internal representation
>> is different between runtimes *and* profiles. Use DateTime.Tick (an
>> int64) or a similar era-based representation.
> 
> But, IIRC, strangely enough, arrays of DateTimes should serialize fine.
> So, you might be better of using a one-element DateTime array.

Look at DateTime's layout:

public struct DateTime
{
         private TimeSpan ticks;
#if NET_2_0
                DateTimeKind kind;
#endif
}

Nasty things would happen if the unmanaged code is profile agnostic.

Robert

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to