请问使用JNA调用dll动态链接库时,类似下面这个方法,phUSBContext这个参数该怎么处理
DWORD CeInitUSBLayer(LPHANDLE phUSBContext, LPDWORD dwSysErr)
Description: Init USB Layer
phUSBContext: USB Layer Context pointer. This parameter must be used as
parameter for others USB API on the same context resource
dwSysErr: 0= NO error , otherwise system error ( GetLastError(..) )
Return Value: 0 = NO Error , for other values see Error Table in CePrnLibDef.h
用结构体
1. 定义结构体
public static class PROGNAME extends Structure{
public static class ByReferenceb extends PROGNAME
implements Structure.ByReference{}
public static class ByValueb extends PROGNAME implements
Structure.ByValue{}
public byte[] comment;
@Override
protected List getFieldOrder() {
return Arrays.asList(new String[] {"comment"});
}
}
2. 调用
PROGNAME.ByReferenceb rs= new PROGNAME.ByReferenceb();
rs.comment =new byte[52];
JNARemoteService.getService().doservice(rs);