zoukankan      html  css  js  c++  java
  • jna调用c++的dll

    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++的接口的输出结果参数名称),获取结果
  • 相关阅读:
    CF149D Coloring Brackets
    CF508D
    CF483C Diverse Permutation
    【纪念】我写过几乎最长的代码
    .net core图片上传详解
    layui插件croppers的使用
    关于日常操作中sql的性能
    leeCode 278
    leeCode刷题 1078
    leeCode刷题 lc184
  • 原文地址:https://www.cnblogs.com/yanduanduan/p/10190974.html
Copyright © 2011-2022 走看看