G
Guest
Hi there,
I had a union in C:
typedef union TagMessage
{
struct {
unsigned char avalue;
unsigned char bvalue;
} a;
struct {
unsigned short cvalue;
} b;
} Message;
From these few links, there is a possible way is to declare a struct with
LayoutKind.Explict and use FieldOffset.
http://www.dotnet247.com/247reference/msgs/18/93017.aspx
http://www.hanselman.com/blog/PermaLink.aspx?guid=187
The problem is how do i relate the FieldOffset in my scenarios. I had 2
structs in my C union. How do i achieve it with the help of that?
Any idea please? Thanks.
I had a union in C:
typedef union TagMessage
{
struct {
unsigned char avalue;
unsigned char bvalue;
} a;
struct {
unsigned short cvalue;
} b;
} Message;
From these few links, there is a possible way is to declare a struct with
LayoutKind.Explict and use FieldOffset.
http://www.dotnet247.com/247reference/msgs/18/93017.aspx
http://www.hanselman.com/blog/PermaLink.aspx?guid=187
The problem is how do i relate the FieldOffset in my scenarios. I had 2
structs in my C union. How do i achieve it with the help of that?
Any idea please? Thanks.