jsp远程调用扫描枪或其它硬件设备

wangxiaoyun987 2010-03-22 09:17:23
开发商给了一个sdk开发包,我用jna调用时可以里面的方法。但是获取不了设备采集的信息。通过java类里的指针类获取不了里面的数据。

那位仁兄有这方面的经验,提供点代码参观一下。
...全文
185 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangxiaoyun987 2010-03-26
  • 打赏
  • 举报
回复
顶!!!!!!!!!!!!!
KevinSu 2010-03-24
  • 打赏
  • 举报
回复
的、顶
wangxiaoyun987 2010-03-24
  • 打赏
  • 举报
回复
只能用指针类型接收
wangxiaoyun987 2010-03-24
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 jumpheightway 的回复:]
返回来的数据用流去接收
然后自己处理
[/Quote]

public short GetNetAccessImage(ByteArrayInputStream bis);

public static void main(String[] args) {
d = CLibrary.INSTANCE.GetNetAccessImage(bis);

}
Exception in thread "main" java.lang.IllegalArgumentException: Unsupported argument type java.io.ByteArrayInputStream at parameter 0 of function GetNetAccessImage
at com.sun.jna.Function.convertArgument(Function.java:552)
at com.sun.jna.Function.invoke(Function.java:259)
at com.sun.jna.Library$Handler.invoke(Library.java:216)
at $Proxy0.GetNetAccessImage(Unknown Source)
at HelloWorld.main(HelloWorld.java:77)
不行失败
jumpheightway 2010-03-24
  • 打赏
  • 举报
回复
返回来的数据用流去接收
然后自己处理
wangxiaoyun987 2010-03-24
  • 打赏
  • 举报
回复
顶起||||||||||||||
gwhok1 2010-03-23
  • 打赏
  • 举报
回复
给楼主顶一个
x_pengcheng 2010-03-23
  • 打赏
  • 举报
回复
帮顶,没遇到过相关的!
  • 打赏
  • 举报
回复
帮顶了……
  • 打赏
  • 举报
回复
坚持一下吧。
wangxiaoyun987 2010-03-23
  • 打赏
  • 举报
回复
再顶 坚持就是胜利
wangxiaoyun987 2010-03-23
  • 打赏
  • 举报
回复
这个人的文章看到过 我可以用jna调用sdk的方法 但是sdk方法为
short GetNetAccessImage(unsigned char *pSourceImg)
当调用该方法时 unsigned char *pSourceImg 将图像写到
*pSourceImg

我在jna中声明引用该方法
public interface CLibrary extends Library {
public static Pointer parray = new Pointer(101376);
CLibrary INSTANCE = (CLibrary)

Native.loadLibrary((Platform.isWindows() ? "BioNetAcsDll" : "c"),CLibrary.class);

public short GetNetAccessImage(Pointer parray);
public static void main(String[] args) {
d = CLibrary.INSTANCE.GetNetAccessImage(parray);

}
}

报错 虚拟机错误 就这里过不去
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0aea33c3, pid=2600, tid=4000
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
# Problematic frame:
# C [BioNetAcsDll.dll+0x33c3]
#
# An error report file with more information is saved as hs_err_pid2600.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
lvyazhou 2010-03-23
  • 打赏
  • 举报
回复
http://blog.csdn.net/shendl/archive/2008/12/23/3589676.aspx
这个也许能帮到你。
wangxiaoyun987 2010-03-23
  • 打赏
  • 举报
回复
顶住啊!!!!!!!!!!!!!!
lovemusic167 2010-03-23
  • 打赏
  • 举报
回复
跟着顶个~~!!!!
wangxiaoyun987 2010-03-23
  • 打赏
  • 举报
回复
谢谢各位等待 牛人
lrg275618939 2010-03-23
  • 打赏
  • 举报
回复
等待大佬
wangxiaoyun987 2010-03-22
  • 打赏
  • 举报
回复
大家没有会的吗?自己顶一下别沉了

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧