import java.util.ArrayList; import java.util.List; import com.sun.jna.Structure; public class MyStructure extends Structure { public static class ByReference extends MyStructure implements Structure.ByReference {} public static class ByValue extends MyStructure implements Structure.ByValue {} public float outputSim; @Override protected List<String> getFieldOrder() { List<String> Field = new ArrayList<String>(); Field.add("outputSim"); return Field; } }
import com.sun.jna.Library; import com.sun.jna.Native; public interface className extends Library { className INSTANCE = (className) Native.loadLibrary(dll路径, className.class); int interfaceName(String A, String B, MyStructure.ByReference ref); }
ByReference ref = new ByReference(); Integer state = className.INSTANCE.interfaceName(A, B, ref);
//ref.(c++的接口的输出结果参数名称),获取结果
所有评论(0)