JNA调用DLL,接收返回值以及错误日志
System.setProperty("jna.encoding", "gbk");
// 首先定义指针,开辟内存空间,这里的内存空间根据返回的字符串来决定
Pointer a = new Memory(10);
Pointer s = new Memory(11);
Pointer d = new Memory(11);
Pointer f = new Memory(11);
Pointer g = new Memory(11);
int mcif = InterfaceDll.Instance.MCIF("1","1", "1", "1", "1", "1", "1", "1", "1", "1", a, s, d, f, g);
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0fe263d8, pid=4264, tid=20288
#
# JRE version: 6.0_45-b06
# Java VM: Java HotSpot(TM) Client VM (20.45-b01 mixed mode, sharing windows-x86 )
# Problematic frame:
# C [MFC42.DLL+0x263d8]
#
# An error report file with more information is saved as:
# D:\MEWorkspace2\Local\hs_err_pid4264.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.
#
我的JDK是32位的 DLL也是32位
执行时而成功,时而不成功,不成功时报错
另成功时,如何获取到返回值 a s d f g的值