B
Bill Medland
I am trying to do some P/Invoke custom marshaling and am looking for a
little help on custom marshaling a value type.
I am working based on Kate Gregory's "Arranging Custom Marshaling With
P/Invoke", which is unfortunately in C++ with managed extensions; I am
working in C#.
As with Kate's example I want to marshal from a System.DateTime to a
proprietary format. However I cannot figure out how to tell the system
to box the DateTime. Can anyone tell me the C# equivalent of __box?
I guess what I want is the C# equivalent of this:
[DllImport("legacy")] bool MyFunc ([In,
MarshalAs(UnmanagedType::CustomMarshaler,
MarshalTypeRef=__typeof(MYDATETYPE_CustomMarshaler))]
__box DateTime* time);
TIA
Bill Medland
little help on custom marshaling a value type.
I am working based on Kate Gregory's "Arranging Custom Marshaling With
P/Invoke", which is unfortunately in C++ with managed extensions; I am
working in C#.
As with Kate's example I want to marshal from a System.DateTime to a
proprietary format. However I cannot figure out how to tell the system
to box the DateTime. Can anyone tell me the C# equivalent of __box?
I guess what I want is the C# equivalent of this:
[DllImport("legacy")] bool MyFunc ([In,
MarshalAs(UnmanagedType::CustomMarshaler,
MarshalTypeRef=__typeof(MYDATETYPE_CustomMarshaler))]
__box DateTime* time);
TIA
Bill Medland