Un favor estory tratando de convertir este codigo de C++ en Delphi, pero al momento de generarlo tengo problemas para idetificar el lector biometrico V-Station G4, y no encuentro en donde pueda estar mal.
Se los voy a gradecer mucho si me pudieran ayudar. Gracias
HUNIT BII_Open_TCPIP_Unit_MT(char* host, unsigned short port, int connTimeout, int
*err)
Y yo lo gnere de la siguiente forma:
function BII_Open_TCPIP_Unit_MT(host:Pchar; port: ushort ; connTimeout: integer ; err: int) : HUNIT ; stdcall; external 'VSeries.dll' name 'BII_Open_TCPIP_Unit_MT'; unit L1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Shellapi, BIIDefines, BIItypes, BIIMTFuntionsBasic; type TFL1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private m_pUnitHandle: HUNIT; m_UnitType: BII_Unit_Type; m_nFingerDataFormat, m_nCommunicationType, m_nSerialPort, m_nBaudRate, m_nDeviceID: Integer; { Private declarations } public { Public declarations } nResult, TCPIP_Port, TCPIP_Timeout: Integer; m_bIsCommunicationEstablished, m_bIsCommPortOpen, m_bIsCurrentPortEnabled, m_bIsAutoFingerDetectDisabled: Boolean; m_strIPADdress: pchar; cIPAddress: array[0..20-1] of char; //cIPAddress: string[20]; end; var FL1: TFL1; implementation {$R *.dfm} procedure TFL1.Button1Click(Sender: TObject); var TotalEntries, ALL_TRANSACTIONS: Integer; begin ALL_TRANSACTIONS := 0; TCPIP_Port:= 10001; TCPIP_TIMEOUT:= 1000; //m_pUnitHandle := null; m_bIsCommunicationEstablished := FALSE; m_bIsCommPortOpen := FALSE; m_bIsCurrentPortEnabled := FALSE; m_bIsAutoFingerDetectDisabled := FALSE; m_nCommunicationType := 1; m_nSerialPort := 1; m_nBaudRate := 115200; m_nDeviceID := 0; //m_strIPADdress := '0.0.0.0'; nResult := 0; // BOOL bSuccess = TRUE; FillChar(&m_UnitType, 0, SizeOf(m_UnitType)); // CloseCommunication(); // close existing communication if (m_nCommunicationType = 1) then // Ethernet m_strIPADdress := '10.10.10.5'; StrCopy(cIPAddress, m_strIPADdress); m_pUnitHandle := BII_Open_TCPIP_Unit_MT(cIPaddress, TCPIP_PORT, TCPIP_TIMEOUT, &nResult); Showmessage('Resultado de m_pUnitHandle: '+inttostr(m_pUnithandle)); if (nResult < 0) then begin Showmessage('Error 1:'+inttostr(nResult)); // y El resultado siempre meda -10006 BII_ERR_INVALID_UNIT_HANDLE m_bIsCommunicationEstablished := FALSE; end else begin m_bIsCommunicationEstablished := TRUE; nResult := BII_Status_MT(m_pUnitHandle) ; if nResult > 0 then begin ShowMessage('Dentro del Estatus de la Unidad'+inttostr(nResult)); end ; // ' Determina el total de todas las transacciones TotalEntries := BII_Get_Num_Transaction_Log_MT(m_pUnitHandle, ALL_TRANSACTIONS); showmessage('Total Mensajes: '+inttostr(TotalEntries)); nResult := BII_Set_Current_NetID_MT(m_pUnitHandle, m_nDeviceID); if (nResult < 0) then begin Showmessage('Error 2:'+inttostr(nResult)); m_bIsCommunicationEstablished := FALSE; end end; if (m_bIsCommunicationEstablished) then begin ShowMessage('Communication was established successfully.'); nResult := BII_Get_Unit_Type_MT(m_pUnitHandle, m_UnitType); // get product type of device nResult := BII_Get_Finger_Data_Format_MT(m_pUnitHandle); // get template format used of device if (nResult > 0) then begin m_nFingerDataFormat := nResult; end; end; end;