谢谢.可以了,现在又有新的问题了.我需要的方法是在DLL中的一个otherOne一个类中的testfun方法.#pragma once class otherOne { public: otherOne(void); ~otherOne(void); int testfun(double&,double&); };#include "StdAfx.h" #include "otherOne.h" otherOne::otherOne(void) { } otherOne::~otherOne(void) { } int otherOne::testfun(double &a,double &b) { a = a + a; b = a + b; return 1; }怎样才能找到testfun的方法呢??
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.ptr.DoubleByReference;public class JNATest { public interface CLibrary extends Library {
CLibrary INSTANCE = (CLibrary) Native.loadLibrary("test.dll", CLibrary.class); double sum(double value, DoubleByReference rtn);
}
public static void main(String[] args){
DoubleByReference dbr = new DoubleByReference();
double value = CLibrary.INSTANCE.sum(100,dbr);
System.out.println("Sum: "+value+", Ref: "+dbr.getValue());
}
}
谢谢.可以了,现在又有新的问题了.我需要的方法是在DLL中的一个otherOne一个类中的testfun方法.#pragma once
class otherOne
{
public:
otherOne(void);
~otherOne(void);
int testfun(double&,double&);
};#include "StdAfx.h"
#include "otherOne.h"
otherOne::otherOne(void)
{
}
otherOne::~otherOne(void)
{
}
int otherOne::testfun(double &a,double &b)
{
a = a + a;
b = a + b;
return 1;
}怎样才能找到testfun的方法呢??