1.在 Windows 中实现 Java 本地方法 
http://www-900.ibm.com/developerWorks/java/jnimthds/index.shtml2.Coroutine for Java 
http://www.nevaobject.com/java/index.htm

解决方案 »

  1.   

    我看了上面的东西,可能我的意思没有表达清楚。
    我要调用的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);
    }
    }
    总说错误的声明
      

  2.   

    you need a wrapper, Coroutine for Java is the perfect solution:The Coroutine for Java class library provides the mechanism for Java to call external functions exported from Windows dynamic link libraries. Coroutine also enables you to dynamically build callable wrappers around Java methods so external functions can call Java methods like they are native functions.
      

  3.   

    该SMEIDLL。DLL文件中的函数声明为
    IFInitInterface(DWORD a,DWORD b,LPCTSTR c);
      

  4.   

    karma(无为),那里有WRAPPER?能给我一个吗?例子?
    email:[email protected]
    thanks a lot!!
      

  5.   

    install Coroutine for Java class library from 
    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()) {
    ...
    }
      
      

  6.   

    test02.java:3: cannot resolve symbol
    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
      

  7.   

    did you turn on your speaker??TestBeep.java:
    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!");
    }  }}
      

  8.   

    请教 karma(无为) :
    用Coroutine for Java 做的wrapper,运行时是不是还需要他的库?
    但是它是试用版的,过期了,我用它做的调用是不是也就不能用了?