I am tyring to pass some variables to a DLL and have to create some strucutures to pass to the DLL, I am trying the best I can to Marshal, but have limited experience with this and am struggling. Surprisingly enough I can get the code to compile and run but am not getting the result expected at all in my output. I was wondering if anyone could look at my marshaling code, of my structure below and let me know if I am doing anything wrong? I am calling the Initialize sub after I Dim a variable to be a new fee_inrecord, through a Sub Main()
Code:
Public Structure fee_inrecord
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim amount() As Double 'Path to data files
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim amount2() As Double
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim whole() As Double
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim min() As Double
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim max() As Double
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim exempt() As Double
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim tax() As Double
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim feetype() As Integer
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim base() As Integer
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim round() As Integer
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim blank() As Integer
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Dim handling() As Integer
'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
Public Sub Initialize()
ReDim amount(98)
ReDim amount2(98)
ReDim whole(98)
ReDim min(98)
ReDim max(98)
ReDim exempt(98)
ReDim tax(98)
ReDim feetype(98)
ReDim base(98)
ReDim round(98)
ReDim blank(98)
ReDim handling(98)
End Sub
End Structure