Hi
I have a C struct that is of the following
typedef struct{
DWORD num_conversions; ...
short *sample_values;
....
} DSCAIOINT;
In VB I'm doing the following
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi, Pack:=1)> _
Public Structure DSCAIOINT
....
Public num_conversions As Integer
....
Public sample_values() As Short
End Structure
in my code I'm passing my DSCAIOINT structure as
Public Declare Function dscADSampleInt Lib "a.dll" ( ByRef dscaioint As
DSCAIOINT) As Byte
However I'm not sure how to marshal the sample_values array so it will be a
short pointer. VB .NET keeps giving me errors of 'System.TypeLoadException'
"Additional information: Can not marshal field sample_values of type
ADSampleInt.DSCAIOINT: This type can not be marshaled as a structure field."
Can any one give me some help? thank you!
--
Kevin Liu