2

嗨,我有这个错误,我不知道如何解决。

c代码是

extern int APIENTRY LSGetDocData(short          hConnect,
                 HWND           hWnd,
                 unsigned long  *NrDoc,
                 LPSTR          FilenameFront,
                 LPSTR          FilenameBack,
                 LPSTR          Reserved1,      // not used must be NULL         LPSTR          Reserved2,      // not used must be NULL         LPHANDLE       *FrontImage,
                 LPHANDLE       *BackImage,
                 LPHANDLE       *Reserved3,     // not used must be NULL         LPHANDLE       *Reserved4,     // not used must be NULL         LPSTR          CodelineSW,
                 LPSTR          CodelineHW,
                 LPSTR          BarCode,
                 LPSTR          CodelinesOptical,
                 short          *DocToRead,
                 long           *NrPrinted,
                 LPVOID         Reserved5,      // not used must be NULL         LPVOID         Reserved6);

我的Java方法是

public int LSGetDocData(short hConnect, int hWnd, long[] NrDoc, String FilenameFront, String FilenameBack, String Reserved1, String Reserved2, int[] FrontImage, int[] RearImage,
            int[] FrontImage2, int[] RearImage2, StringBuffer CodelineSW, StringBuffer CodelineHW, StringBuffer Barcode, StringBuffer CodelinesOptical, short[] DocToRead, long[] NrPrinted,
            int Reserved5, int Reserved6);



public int lSGetDocData(long[] nrDoc, int[] frontImage, int[] rearImage,StringBuffer micrHW, StringBuffer barcode,StringBuffer micrSW,StringBuffer codeLineOptical) {

        return LsApi.call.LSGetDocData(hConnect[0], hWnd, nrDoc, "imageF", "ImageR", null, null, frontImage, rearImage, null, null, micrSW, micrHW, barcode, codeLineOptical, new short[0], new long[0], 0, 0);
    }

错误是

java.lang.IllegalArgumentException:函数 LSGetDocData 的参数 11 处不支持的参数类型 java.lang.StringBuffer

我尝试将 StringBuffer 转换为 String - Char - Pointer - Memory 并且应用程序显示此错误

invalid access memory

所以如果有人知道如何将 StringBuffer 转换为 ?? 我将永远感激不已提前谢谢

4

0 回答 0