首页 新闻 赞助 找找看

C#调用顶尖PBUSDRV.DLL时,如果保质期shleftime大于3时,下传就报错

0
悬赏园豆:40 [待解决问题]
结构体声明如下:

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct TPlu
{
//[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 36)]
public string Name;
public int LFCode;
//[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 10)]
public string code;
public int barcode;

public int unitprice;
public int weightunit;
public int deptment;
public double tare;

public int shleftime;

public int packagetype;
public int packageweight;
public int tolerance;
//[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 1)]
public byte message1;

//[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 1)]
public byte reserved;
public short reserved1;
//[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 1)]
public byte message2;
public byte reserved2;

//[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 1)]
public byte multilabel;
//[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 1)]
public byte rebate;
public int account;
}

其它INT型的参数都一切正常,唯独shleftime大于3时,下传就报错。0-3下传正常。是否要特殊处理?
文档对于保存期shleftime的说明:宽度 3,默认 15,描述:0~365, 其中 364: 不打印有效期; 365: 有效期和包
装日期均不打印包装日期为零时,包装日期及保鲜日
期均打印。

然而同样写的PB,VB程序则正常。
runliuv的主页 runliuv | 初学一级 | 园豆:48
提问于:2015-07-17 21:26
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册