X
xinsir
dynamic array as a byref parameter by used in function and
have a Marshal error ,what is the matter?thanks
source like as this .
------------------------------------------------------
Declare Function finit Lib "DllCap.dll" _
(ByRef rdAcnt As ACNTINF2) As Integer
<StructLayout(LayoutKind.Sequential)> Structure ACNTINF
<MarshalAs(UnmanagedType.ByValTStr, sizeconst:=16)> Dim
subid As String
<MarshalAs(UnmanagedType.ByValTStr, sizeconst:=40)> Dim
subname As String
End Structure
<StructLayout(LayoutKind.Sequential)> Structure ACNTINF2
<MarshalAs(UnmanagedType.ByValTStr, sizeconst:=10)> Dim
acntnum As String
<MarshalAs(UnmanagedType.LPStruct)> Dim actInfo() As
ACNTCNT
End Structure
Private Sub FORM1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Dim rdAcnt2 As ACNTINF2
Dim iRtn As Integer
iRtn = finit(rdAcnt2)
End Sub
have a Marshal error ,what is the matter?thanks
source like as this .
------------------------------------------------------
Declare Function finit Lib "DllCap.dll" _
(ByRef rdAcnt As ACNTINF2) As Integer
<StructLayout(LayoutKind.Sequential)> Structure ACNTINF
<MarshalAs(UnmanagedType.ByValTStr, sizeconst:=16)> Dim
subid As String
<MarshalAs(UnmanagedType.ByValTStr, sizeconst:=40)> Dim
subname As String
End Structure
<StructLayout(LayoutKind.Sequential)> Structure ACNTINF2
<MarshalAs(UnmanagedType.ByValTStr, sizeconst:=10)> Dim
acntnum As String
<MarshalAs(UnmanagedType.LPStruct)> Dim actInfo() As
ACNTCNT
End Structure
Private Sub FORM1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Dim rdAcnt2 As ACNTINF2
Dim iRtn As Integer
iRtn = finit(rdAcnt2)
End Sub