1.在 Windows 中实现 Java 本地方法
http://www-900.ibm.com/developerWorks/java/jnimthds/index.shtml2.Coroutine for Java
http://www.nevaobject.com/java/index.htm
http://www-900.ibm.com/developerWorks/java/jnimthds/index.shtml2.Coroutine for Java
http://www.nevaobject.com/java/index.htm
我要调用的DLL是别人用C开发的,不是我自己开发本地的DLL;
我没有该DLL的代码,只有一个*。DLL的文件
public class test02
{
public native boolean IFInitInterface(long a,long b,String c);
static
{
System.loadLibrary("smeidll");
}public static void main(String args[])
{
long e=2;
long f=1;
String g="133.96.50.12 5000 5018";
test02 atest=new test02();
boolean d=atest.IFInitInterface(e,f,g);
}
}
总说错误的声明
IFInitInterface(DWORD a,DWORD b,LPCTSTR c);
email:[email protected]
thanks a lot!!
http://www.nevaobject.com/java/index.htmhere is an example about how to call "Beep" API from Kernel32.DLLCoroutine api=new Coroutine ("KERNEL32", "Beep");
api.addArg(1770);
api.addArg(999);
if(0 !== api.invoke()) {
// Error
System.out.println("Error in invoke "+api.lastError());
}if(api.answerAsBoolean()) {
...
}
symbol : class Coroutine
location: class test02
Coroutine api=new Coroutine ("KERNEL32", "Beep");
^
test02.java:3: cannot resolve symbol
symbol : class Coroutine
location: class test02
Coroutine api=new Coroutine ("KERNEL32", "Beep");
^
2 errors
import com.neva.*;public class TestBeep
{
public static void main(String[] args)
{
Coroutine api=new Coroutine ("KERNEL32", "Beep");
api.addArg(1770);
api.addArg(999); if(0 != api.invoke()) {
// Error
System.out.println("Error in invoke "+api.lastError());
}
if(api.answerAsBoolean()) {
System.out.println("Good!");
} }}
用Coroutine for Java 做的wrapper,运行时是不是还需要他的库?
但是它是试用版的,过期了,我用它做的调用是不是也就不能用了?