Click here to Skip to main content
15,112,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello
i work on a biomatrix software and use Futronic scaner

file name Scanner.java

scaner API Code here :-
VB.NET
import javax.swing.JOptionPane;



import mindact.root_file;


public class Scanner {
	public Scanner()
    {
    }

    public native boolean OpenDevice();

    public native boolean CloseDevice();

    public native String GetVersionInfo();

    public native boolean GetImageSize();

    public native boolean IsFingerPresent();

    public native boolean GetFrame(byte abyte0[]);

    public native boolean GetImage2(int i, byte abyte0[]);

    public native boolean SetOptions(int i, int j);

    public native int GetLastErrorCode();

    public native boolean Save7Bytes(byte abyte0[]);

    public native boolean Restore7Bytes(byte abyte0[]);

    public native boolean SetNewAuthorizationCode(byte abyte0[]);

    public native boolean SaveSecret7Bytes(byte abyte0[], byte abyte1[]);

    public native boolean RestoreSecret7Bytes(byte abyte0[], byte abyte1[]);

    public native boolean SetDiodesStatus(int i, int j);

    public native boolean GetDiodesStatus(byte abyte0[]);

    public int GetImageWidth()
    {
        return m_ImageWidth;
    }

    public int GetImaegHeight()
    {
        return m_ImageHeight;
    }

    public java.lang.String GetErrorMessage()
    {
        int errcode = GetLastErrorCode();
        java.lang.String strErrMsg;
        switch(errcode)
        {
        case 0: // '\0'
            strErrMsg = "OK";
            break;

        case 4306: 
            strErrMsg = "Empty Frame";
            break;

        case 536870913: 
            strErrMsg = "Moveable Finger";
            break;

        case 536870914: 
            strErrMsg = "Fake Finger";
            break;

        case 536870916: 
            strErrMsg = "Hardware Incompatible";
            break;

        case 536870917: 
            strErrMsg = "Firmware Incompatible";
            break;

        case 536870918: 
            strErrMsg = "Invalid Authorization Code";
            break;

        case 19: // '\023'
            strErrMsg = "Write Protect";
            break;

        default:
            strErrMsg = java.lang.String.format("Error code is %d", new java.lang.Object[] {
                java.lang.Integer.valueOf(errcode)
            });
            break;
        }
        return strErrMsg;
    }

    public final int FTR_ERROR_NO_ERROR = 0;
    public final int FTR_OPTIONS_CHECK_FAKE_REPLICA = 1;
    public final int FTR_OPTIONS_DETECT_FAKE_FINGER = 1;
    public final int FTR_OPTIONS_IMPROVE_IMAGE = 32;
    public final int FTR_OPTIONS_INVERT_IMAGE = 64;
    public final int FTR_ERROR_EMPTY_FRAME = 4306;
    public final int FTR_ERROR_MOVABLE_FINGER = 0x20000001;
    public final int FTR_ERROR_NO_FRAME = 0x20000002;
    public final int FTR_ERROR_HARDWARE_INCOMPATIBLE = 0x20000004;
    public final int FTR_ERROR_FIRMWARE_INCOMPATIBLE = 0x20000005;
    public final int FTR_ERROR_INVALID_AUTHORIZATION_CODE = 0x20000006;
    public final int FTR_ERROR_WRITE_PROTECT = 19;
    private int m_ImageWidth;
    private int m_ImageHeight;

    static 
    {
        try
        {
            java.lang.String libFile1 = "";
            java.lang.String libFile2 = "";
            if(java.lang.System.getProperty("os.arch").equals("amd64"))
            {
                libFile1 = "x64\\ftrScanAPI.dll";
                libFile2 = "x64\\ftrJavaScanAPI.dll";
            } else
            {
                libFile1 = "x86\\ftrScanAPI.dll";
                libFile2 = "x86\\ftrJavaScanAPI.dll";
            }
            //java.lang.System.loadLibrary("ftrScanAPI");
            //java.lang.System.loadLibrary("ftrJavaScanAPI");
            java.lang.System.load((new StringBuilder()).append(root_file.getroot()).append("\\lib\\").append(libFile1).toString());
            java.lang.System.load((new StringBuilder()).append(root_file.getroot()).append("\\lib\\").append(libFile2).toString());
        }
        catch(java.lang.Exception ex)
        {
            javax.swing.JOptionPane.showMessageDialog(((java.awt.Component) (null)), ((java.lang.Object) (ex)));
        }
    }

}


and error is
VB.NET
Exception in thread "Thread-4" java.lang.UnsatisfiedLinkError: Futronic.ScanApiHelper.Scanner.OpenDevice()Z
	at ScanApiHelper.Scanner.OpenDevice


please help,
thanks in advance
Posted
Comments
Richard MacCutchan 25-Nov-15 4:36am
   
Something is wrong with your libraries. You should check that your loadpaths are being generated correctly, and use your debugger to trace through what is happening.
Rajesh Lagaria 29-Nov-15 8:39am
   
i recheck in debug mode and found that this error happen in 64-bit OS, in 32-bit OS work fine.
Richard MacCutchan 29-Nov-15 11:14am
   
Sounds like you need to ensure all parts are 32-bit.
Rajesh Lagaria 2-Dec-15 10:27am
   
i use both x64 and x86 dll
Richard MacCutchan 2-Dec-15 10:30am
   
Yes, but you need to ensure that the libraries that you are using are consistent, all 32 bit or all 64 bit. You also need to ensure that the names of the methods you are calling are correct. The error message above provides all the information you need.
Rajesh Lagaria 17-Dec-15 8:50am
   
thanks Richard. after all I notice that the error rise in windows 10 64bit only. In windows pre versions 64bit and 32bit working smoothly.
Member 12157311 26-Nov-15 6:20am
   
Have you generated the Scanner header file and use it within your C++ project?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900