我现在在java里要调用别人给写好的dll
在网上搜了很多的方法 都有点懵。
我现在用的是这样的:
public static void main(String[] args)
{
//Test2 t=new Test2();
JNative jn=null;
String str="";
try {
jn=new JNative("C:/Program Files/Java/jdk1.6.0/bin/testDll.dll","MyCall");
jn.setRetVal(Type.STRING);
jn.setParameter(0,Type.STRING,"yf");
jn.invoke();
str = jn.getRetVal();
System.out.println(str);
} catch (NativeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
工程中添加了JNative.jar。都配置好了以后
运行的时候报了这样的错
#
# An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02e43f56, pid=616, tid=744
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-rc-b104 mixed mode, sharing)
# Problematic frame:
# C [testDll.dll+0x3f56]
#
# An error report file with more information is saved as hs_err_pid616.log
#
代码如下 ,我想通过代理访问一些网址,但是不知道如何测试代理成功,我想通过访问“http://www.blogger.com/”来看看是否代理成功,但是也不能访问,出现异常“Unexpected end of file from server”,但是如果不这 ......