T
Tom
I'm trying to pass this structure to a dll:
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi, Pack:=1)> _
Public Structure udtINTER01
<VBFixedString(8), MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)>
Public action As Char()
<VBFixedString(7), MarshalAs(UnmanagedType.ByValArray, SizeConst:=7)>
Public equip_key As Char()
<VBFixedString(256), MarshalAs(UnmanagedType.ByValArray,
SizeConst:=256)> Public message As Char()
<VBFixedString(512), MarshalAs(UnmanagedType.ByValArray,
SizeConst:=512)> Public filler As Char()
End Structure
When I pass it to my dll I get this message:
An unhandled exception of type 'System.ArgumentException' occured in
Test1.exe
Additional Information: Type could not be marshaled because the length
of an embedded array instance does not match the declared length in the
layout
I reviewed the length of each element of the structure and they all
match the declared lengths.
What does it want??
Tom
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi, Pack:=1)> _
Public Structure udtINTER01
<VBFixedString(8), MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)>
Public action As Char()
<VBFixedString(7), MarshalAs(UnmanagedType.ByValArray, SizeConst:=7)>
Public equip_key As Char()
<VBFixedString(256), MarshalAs(UnmanagedType.ByValArray,
SizeConst:=256)> Public message As Char()
<VBFixedString(512), MarshalAs(UnmanagedType.ByValArray,
SizeConst:=512)> Public filler As Char()
End Structure
When I pass it to my dll I get this message:
An unhandled exception of type 'System.ArgumentException' occured in
Test1.exe
Additional Information: Type could not be marshaled because the length
of an embedded array instance does not match the declared length in the
layout
I reviewed the length of each element of the structure and they all
match the declared lengths.
What does it want??
Tom