第一步:编写Java代码,使用关键字native标记要用C++动态链接库来实现的方法。
譬如:fxq.java
package com.szkingdom.kssp.util;
public class fxq {
private static boolean init = false;
static {
System.loadLibrary("fxq");
init = (0 == InitDLL ());
}
public fxq() {}
public static int processKY (String batchId) {
if(init) {
return ProcessKY(batchId);
}
return -1;
}
public static int processBig (String batchId) {
if(init) {
return ProcessBig(batchId);
}
return -1;
}
public static int reCreateKY (String batchId, String oldFileName) {
if(init) {
return ReCreateKY(batchId, oldFileName);
}
return -1;