用javah来生成头文件,java和其它都能调用的。

解决方案 »

  1.   

    To: takecare(大厅):
    能具体点吗?
    我在java中,选中我的.java文件,但是我将该.java文件编译成.h文件后,在我工程里却找不到,搜索了一下也没有找到,这是什么原因啊???
      

  2.   

    System.loadLibrary("dll的名字" );然后在DLL里面的方法写进类..就是EJB的远程接口差不多.
      

  3.   

    1.create a class for dll;
    2.in the class, write the same name native method according to the DLL;
    3.call System.loadLibrary("") to load the dll;
    for example:
    public class xxxx
    {
    static public native long Getxxx(...);
    static public native boolean Init(...);
             //...
    static{
    try{
    System.loadLibrary("...");//string is dll name(exclude ".dll");
    }
    catch(java.lang.UnsatisfiedLinkError e)
    {
                            System.out.println(e.getLocalizedMessage() );
    }
    }}
    call method:
     boolean bInit = xxxx.Init(...);
      

  4.   

    写一个用于Java调用的JNI C的DLL,在这个DLL中去调用你想调用的DLL中的函数