-1
我試圖調用下面的德爾菲法調用德爾菲法:無效的內存訪問時通過JNA
不過,我得到這個異常:
這裏是我的代碼:
public static void main(String[] args) throws Exception {
//解決中文亂碼a
System.setProperty("jna.encoding", "GBK");
byte[] b = FileUtil.file2ByteArray("C:/Users/Administrator/Desktop/work/jyp/dll/鑽孔檢驗批質量驗收記錄表.LIL");
System.out.println(b);
String nn = "llllllllllll";
//System.out.println(testdll.Instance.PBF_RepToPDF_File("C:/Users/Administrator/Desktop/work/jyp/dll/1啊.LIL","C:/Users/Administrator/Desktop/work/jyp/dll/1_File.PDF"));
//JYP_TK_ReportDLL.Instance.PBF_RepToPDF_File("C:/Users/Administrator/Desktop/work/jyp/dll/1啊.LIL","C:/Users/Administrator/Desktop/work/jyp/dll/1_File.PDF");
JYP_TK_ReportDLL.Instance.PBF_RepToPDF_Stream("C:/Users/Administrator/Desktop/work/jyp/dll/1.PDF",nn);
//JYP_TK_ReportDLL.Instance.PBF_RepToJPG_File("C:/Users/Administrator/Desktop/work/jyp/dll/1啊.LIL","C:/Users/Administrator/Desktop/work/jyp/dll/1_File.JPG");
}
public interface JYP_TK_ReportDLL extends Library {
JYP_TK_ReportDLL Instance = (JYP_TK_ReportDLL) Native.loadLibrary("JYP_TK_ReportDLL",
JYP_TK_ReportDLL.class);
boolean PBF_RepToPDF_Stream(String SaveFile, String arr);
boolean PBF_RepToPDF_File(String SourceFile, String SaveFile);
boolean PBF_RepToJPG_File(String SourceFile, String SaveFile);
}
記得從'StdCallLibrary'擴展而不是'Library'。 – cubrr