N
Nigel Walton
I am trying to read some data from a dll via a callback. I have a
deligate and all imformation is correct except for an array.
This is the original struct in c:
typedef void (*PutSampProc)(short samples[], int arraylen, int
nrsamples,void *userData);
This does not work:
<StructLayout(LayoutKind.Sequential)> _
Public Structure PutSampProc2
<MarshalAs(UnmanagedType.ByValArray,SizeConst:=1024)> _
Dim Samples() As Short
Dim ArrayLen As Integer
Dim NrSamples As Integer
Dim Userdata As Byte
End Structure
This gives the correct data for ArrayLen, NrSamples and Userdata, but
just a value for the Samples():
<StructLayout(LayoutKind.Sequential)> _
Public Structure PutSampProc
Dim Samples As Integer
Dim ArrayLen As Integer
Dim NrSamples As Integer
Dim Userdata As Byte
End Structure
What am I doing wrong????
Please help
Nigel
deligate and all imformation is correct except for an array.
This is the original struct in c:
typedef void (*PutSampProc)(short samples[], int arraylen, int
nrsamples,void *userData);
This does not work:
<StructLayout(LayoutKind.Sequential)> _
Public Structure PutSampProc2
<MarshalAs(UnmanagedType.ByValArray,SizeConst:=1024)> _
Dim Samples() As Short
Dim ArrayLen As Integer
Dim NrSamples As Integer
Dim Userdata As Byte
End Structure
This gives the correct data for ArrayLen, NrSamples and Userdata, but
just a value for the Samples():
<StructLayout(LayoutKind.Sequential)> _
Public Structure PutSampProc
Dim Samples As Integer
Dim ArrayLen As Integer
Dim NrSamples As Integer
Dim Userdata As Byte
End Structure
What am I doing wrong????
Please help
Nigel