参照的dll里面定义的结构体
Public Structure MMP_MIX_RECORD
<VBFixedString(5), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=5)> Public auchItemNo As String <VBFixedString(21), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=21)> Public auchPluNo As String <VBFixedString(9), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=9)> Public auchSaleStartDate As String
<VBFixedString(5), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=5)> Public auchSaleStartTime As String
<VBFixedString(9), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=9)> Public auchSaleEndDate As String
<VBFixedString(5), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=5)> Public auchSaleEndTime As String
Dim usMixType As Short
Dim usPriceMulti1 As Short
Dim ulDiscountPrice1 As Integer
Dim usPriceMulti2 As Short
Dim ulDiscountPrice2 As Integer
<VBFixedString(19), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=19)> Public auchMnemonic As String
<VBFixedString(9), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=9)> Public auchEntryDate As String
<VBFixedString(7), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=7)> Public auchEntryTime As String
End Structure
然后再程序里面定义了一个相同的结构体
在赋值的时候出现 值不能变换的错误
Private Function FncAgentMixDirectReplace(ByRef sModuleName As String, ByRef NewRec As MMP_MIX_RECORD, ByRef OldRec As MMP_MIX_RECORD, ByRef lStatus As Integer) As Short
Dim nRet As Short
nRet = RGS_Tool4PluCliVB.RtsRgsMixDirectReplaceRec(p_dsSystemInfo, NewRec, OldRec, lStatus)
End Function
参照的DLL中的方法
Public Function RtsRgsMixDirectReplaceRec(ByRef io_dsSystemInfo As System.Data.DataSet, ByRef pNewRecord As NCR.RealGate.Rpro.IZ.ClientFramework.ToolLibraryRGS4PluCliVB.basPluCliVB.MMP_MIX_RECORD, ByRef pOldRecord As NCR.RealGate.Rpro.IZ.ClientFramework.ToolLibraryRGS4PluCliVB.basPluCliVB.MMP_MIX_RECORD, ByRef pusStatus As Integer) As Short
哪位大侠讲解一下,结构体作为一个参数改怎么传值??
3 个解决方案
#1
>然后再程序里面定义了一个相同的结构体
这句话是说在程序中又重新定义了一个名字叫MMP_MIX_RECORD的结构体么?还是定义了一个dll中的MMP_MIX_RECORD结构体的对象?
这句话是说在程序中又重新定义了一个名字叫MMP_MIX_RECORD的结构体么?还是定义了一个dll中的MMP_MIX_RECORD结构体的对象?
#2
程序和引用的DLL里面都定义了一样的结构体
#3
#1
>然后再程序里面定义了一个相同的结构体
这句话是说在程序中又重新定义了一个名字叫MMP_MIX_RECORD的结构体么?还是定义了一个dll中的MMP_MIX_RECORD结构体的对象?
这句话是说在程序中又重新定义了一个名字叫MMP_MIX_RECORD的结构体么?还是定义了一个dll中的MMP_MIX_RECORD结构体的对象?
#2
程序和引用的DLL里面都定义了一样的结构体