What I'm trying to do is have a structure of a variety of
types of fields, and then I need to pass the whole thing
as a string later on. So I tried (see below) to use
LayoutKind.Expl icit with FieldOffset, where I first set
the offset 0 to a string and then laid down the rest of
my fields. But instead of working like a union, it lays
the fields down sequentially (they don't overlap each
other as expected). Anybody know how to do this?
Thanks,
Joel
<System.Runtime .InteropService s.StructLayout
(System.Runtime .InteropService s.LayoutKind.Ex plicit)>
Public Structure IPCInitReqUnion
<System.Runtime .InteropService s.FieldOffset(0 )
Dim s As String <System.Runtime .InteropService s.FieldOffset(0 ) Dim HEADER As MyHeaderClass
<System.Runtime .InteropService s.FieldOffset
(88)> Dim USERID As String
<System.Runtime .InteropService s.FieldOffset
(120)> Dim PASSWORD As String
<System.Runtime .InteropService s.FieldOffset
(152)> Dim LocalLogon As Short
<System.Runtime .InteropService s.FieldOffset
(154)> Dim FTPProcessName( ) As String
<System.Runtime .InteropService s.FieldOffset
(184)> Dim NodeCount As Short
End Structure