Jon,
sorry, there was just a typing error... here's the right code:
...
public unsafe void FillMyStruct(string s)
{
//
// convert the given string into a byte array
//
byte[] data = Encoding.UTF8.GetBytes(s);
//
// create another byte array for storing
Jon,
that you said is really interesting... and I'm wondering how
can I solve another similar problem. Giving the following type:
[StructLayout(LayoutKind.Sequential)]
internal struct MyStruct
{
public int Id;
public byte[] Data; // of course, that's wrong!!!
}
... I'd like to
On Sun, 2005-10-23 at 15:21 +0200, Giuseppe Greco wrote:
Jon,
that you said is really interesting... and I'm wondering how
can I solve another similar problem. Giving the following type:
[StructLayout(LayoutKind.Sequential)]
internal struct MyStruct
{
public int Id;
public
Thanks Jon!
Another alternative would be the following:
[StructLayout(LayoutKind.Sequential)]
internal struct MyStruct
{
public int Id;
public unsafe byte* Data;
}
public unsafe void FillMyStruct(string s)
{
//
// convert the given string into a byte array
//
On Sun, 2005-10-23 at 21:09 +0200, Giuseppe Greco wrote:
Another alternative would be the following:
[StructLayout(LayoutKind.Sequential)]
internal struct MyStruct
{
public int Id;
public unsafe byte* Data;
}
public unsafe void FillMyStruct(string s)
{
...
On Thu, 2005-10-20 at 16:07 -0700, Shankari wrote:
While marshalling class and structure members, Mono
doesnt do a deep marshal.
If the structure has a string member, a default of
charset.auto is set.
Would you prefer some other default?
But if the structure has an array of integers, what
Hello,
While marshalling class and structure members, Mono
doesnt do a deep marshal.
If the structure has a string member, a default of
charset.auto is set.
But if the structure has an array of integers, what
would be done in that case?
In general, if an array of simple types is a member of
the