J
James Grennan via .NET 247
I wonder if anyone could help me with this code.
I found some code from Microsoft to ping a host written in VB.NET and it works perfect in the standard framework.
(See http://support.microsoft.com/default.aspx?scid=kb;en-us;828993 )
I want to use it in the compact framework, but I get a compile error.
The CF.NET does not seem to recognise the FieldOffset Attribute
I don?t have enough experience in Marshalling to fixed this.
The code with the problem is :
<StructLayout(LayoutKind.Explicit)> Structure UNION_INT16
<FieldOffset(0)> Dim lsb As Byte
<FieldOffset(1)> Dim msb As Byte
<FieldOffset(0)> Dim w16 As Short
End Structure
<StructLayout(LayoutKind.Explicit)> Structure UNION_INT32
<FieldOffset(0)> Dim lsw As UNION_INT16
<FieldOffset(2)> Dim msw As UNION_INT16 '
<FieldOffset(0)> Dim w32 As Integer
End Structure
I found some code from Microsoft to ping a host written in VB.NET and it works perfect in the standard framework.
(See http://support.microsoft.com/default.aspx?scid=kb;en-us;828993 )
I want to use it in the compact framework, but I get a compile error.
The CF.NET does not seem to recognise the FieldOffset Attribute
I don?t have enough experience in Marshalling to fixed this.
The code with the problem is :
<StructLayout(LayoutKind.Explicit)> Structure UNION_INT16
<FieldOffset(0)> Dim lsb As Byte
<FieldOffset(1)> Dim msb As Byte
<FieldOffset(0)> Dim w16 As Short
End Structure
<StructLayout(LayoutKind.Explicit)> Structure UNION_INT32
<FieldOffset(0)> Dim lsw As UNION_INT16
<FieldOffset(2)> Dim msw As UNION_INT16 '
<FieldOffset(0)> Dim w32 As Integer
End Structure