#include <windows.h> #include #include "MORPHO_User.h" #include "MORPHO_Device.h" #include "MORPHO_Database.h" #include "MORPHO_Errors.h" #include "MORPHO_FieldDescriptor.h" using namespace std ; #pragma comment(lib,"MORPHO_SDK.lib") HMODULE hinstDLL; int res; char *mso_name,*mso_prop; C_MORPHO_User u,nw,idf; C_MORPHO_Database cdb; C_MORPHO_Device c; C_MORPHO_TemplateList tmp_list; unsigned long t,nb_rcd,fld_ln,fld_uln,nb_user; unsigned char *id,*fld_dt,*fld_nm,*fld_nwnm,*fld_udt; T_MORPHO_FIELD_ATTRIBUTE fld_att; unsigned short fld_sz; BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH : OutputDebugString("DLL_PROCESS_ATTACH\n"); break; case DLL_THREAD_ATTACH : OutputDebugString("DLL_THREAD_ATTACH\n"); break; case DLL_THREAD_DETACH : OutputDebugString("DLL_THREAD_DETACH\n"); break; case DLL_PROCESS_DETACH : OutputDebugString("DLL_PROCESS_DETACH\n"); break; } return true; } /////////////////////////////////////////////////////////////////////////////// // Initialize // //////////////////////////////////////////////////////////////////////////////// extern "C" int WINAPI Initialize() { hinstDLL=LoadLibrary("MORPHO_SDK.dll"); if (hinstDLL == NULL) { return 0; } return 1; // Write here all the code you need to initialize the DLL } //////////////////////////////////////////////////////////////////////////////// // Release // //////////////////////////////////////////////////////////////////////////////// extern "C" void WINAPI Release() { FreeLibrary(hinstDLL); // Write here all the code you need to free everything ... } //////////////////////////////////////////////////////////////////////////////// // opendevice // //////////////////////////////////////////////////////////////////////////////// extern "C" int WINAPI opendevice() { c=C_MORPHO_Device::C_MORPHO_Device(); res=c.OpenDevice(-1,115200); return (res); } //////////////////////////////////////////////////////////////////////////////// // initUsb // //////////////////////////////////////////////////////////////////////////////// extern "C" int WINAPI initUsb() { res=c.InitUsbDevicesNameEnum(&t); if(res==0) { int nb=(int)t; return(nb); }else { return(res); } } //////////////////////////////////////////////////////////////////////////////// // getdatabase // //////////////////////////////////////////////////////////////////////////////// extern "C" int WINAPI getdatabase() { res=c.GetDatabase(0,cdb); return(res); } //////////////////////////////////////////////////////////////////////////////// // getnbrrecord // //////////////////////////////////////////////////////////////////////////////// extern "C" int WINAPI getnbrrecord() { res=cdb.GetNbUsedRecord(nb_rcd); if(res==0) { int nbr=(int)nb_rcd; return(nbr); }else { return(res); } } //////////////////////////////////////////////////////////////////////////////// // getuser // //////////////////////////////////////////////////////////////////////////////// extern "C" int WINAPI getuser(int id) { unsigned char reg[50]; sprintf((char*)reg, "%i", id); res=cdb.GetUser(MORPHO_USER_ID_MAXLEN,reg,u); return(res); } //////////////////////////////////////////////////////////////////////////////// // enroll // //////////////////////////////////////////////////////////////////////////////// extern "C" int WINAPI enroll() { res=u.Enroll(0,0x01,MORPHO_PK_COMP,0,NULL,NULL); return(res); } //////////////////////////////////////////////////////////////////////////////// // identify // //////////////////////////////////////////////////////////////////////////////// extern "C" int WINAPI identify() { res=cdb.Identify(0x11,MORPHO_FAR_5,0,NULL,NULL,idf); if(res==0) { res=idf.GetField(0,fld_uln,fld_udt); int nv=atoi((char*)fld_udt); return(nv); }else{ return(res); } }
extern "C" void WINAPI Release() { FreeLibrary(hinstDLL); // Write here all the code you need to free everything ... }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionException in thread "AWT-EventQueue-1" java.lang.UnsatisfiedLinkError: Unable to load library 'newdll': Le module spécifié est introuvable.
C_MORPHO_User u,nw,idf; C_MORPHO_Database cdb; C_MORPHO_Device c; C_MORPHO_TemplateList tmp_list;