有一段程序,调用一个数据库的动态链接库(JNA可以直接调用,不用在生成动态链接库)import com.sun.jna.*;
public class getPIJNA
{
public static void main(String[] args) throws Exception
{
int b=0;
lib.pipt_findpoint("CDT158", b);
System.out.println("b="+b);
}
}interface PIAPI32 extends Library
{
PIAPI32 INSTANCE = (PIAPI32) Native.loadLibrary("piapi32", PIAPI32.class);
int pipt_findpoint(String tagName, String pointNumber);
}
lib.pipt_findpoint("CDT158", b)这个方法的作用是可以根据CDT158这个point name返回相应的point id。
我调用这个命令得到b时,java报错:# An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x65609613, pid=4528, tid=4560
#
# Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86)
# Problematic frame:
# C [piapi32.dll+0x9613]
#
# An error report file with more information is saved as:
# G:\workspace\testPIEDA\hs_err_pid4528.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
跪求达人可以帮我解决这个问题,得到b值,多谢多谢!!!
public class getPIJNA
{
public static void main(String[] args) throws Exception
{
int b=0;
lib.pipt_findpoint("CDT158", b);
System.out.println("b="+b);
}
}interface PIAPI32 extends Library
{
PIAPI32 INSTANCE = (PIAPI32) Native.loadLibrary("piapi32", PIAPI32.class);
int pipt_findpoint(String tagName, String pointNumber);
}
lib.pipt_findpoint("CDT158", b)这个方法的作用是可以根据CDT158这个point name返回相应的point id。
我调用这个命令得到b时,java报错:# An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x65609613, pid=4528, tid=4560
#
# Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86)
# Problematic frame:
# C [piapi32.dll+0x9613]
#
# An error report file with more information is saved as:
# G:\workspace\testPIEDA\hs_err_pid4528.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
跪求达人可以帮我解决这个问题,得到b值,多谢多谢!!!
解决方案 »
- 求助如何在一个activity动态加载另外的activity类
- 我快疯了,跪求java包的导入(写的servlet无法调用javabean)
- 简单问题,求前辈帮忙!!!
- 自己写一个equals的方法应该满足哪些条件的?
- 100分请教:怎么在有包类下调用无包类
- 关于一道笔试题
- java联机小游戏,做了一半,socket没学,联机不怎么会,求指导一个玩家控制点,一个玩家控制蛇,在电脑的局域网实现
- 关于文件RadomAccess的定位,请大家帮忙
- 关于String的简单问题,在线等待
- 为什么java rmi的helloworld程序不用生成stub也能运行
- 用java实现常用数据结构栈和队列.
- 关于对Runtime.exec()方法的疑惑
lib哪里来的?没看见声明也没有看见初始化
PIAPI32 lib = PIAPI32.INSTANCE;