0
Answer

Help Marshalling

Ask a question
lars

lars

19y
2.1k
1
if you have any clu or experience i would apriciate some help her we go again here we go again i get an compiler error that it cant find the size of the structure in this rutine buf = new byte[Marshal.SizeOf(dmh.imageInfo)]; if i mark out this from the structure it works [MarshalAs(UnmanagedType.LPStruct, SizeConst=8, ArraySubType = UnmanagedType.LPStruct )] DpxChannelInformation[] channel; so i think it cant find the size of this structure because it have an array od structres public struct DpxImageInformation { UInt16 orientation; UInt16 channels_per_image; UInt32 pixels_per_line; UInt32 lines_per_image; [MarshalAs(UnmanagedType.LPStruct, SizeConst=8, ArraySubType = UnmanagedType.LPStruct )] DpxChannelInformation[] channel; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 52)] string[] reserved; }