No soy muy bueno con C++, y tengo que acceder a un biometrico SeguGen Haster IV
Tengo la dll que me enviaron con el SDK "SecuBSPMx.dll", y tengo este ejemplo en C++
- Code: Select all Expand view RUN
#include "stdafx.h"
#include "BSPDemo.h"
#include "BSPDemoDlg.h"
// Initialize variables
m_hLib = 0;
m_hBSP = 0;
BOOL OnInitDialog()
{
if (InitSecuBSP())
m_StatusBar = _T("BSP module initialization success !");
else
m_StatusBar = _T("BSP module initialization failed !");
return TRUE; // return TRUE unless you set the focus to a control
}
//-------------------------------------------------------
bool InitSecuBSP()
{
CString strSecuBSPMx(_T("SecuBSPMx.dll"));
m_hLib = LoadLibrary(strSecuBSPMx);
if ( !m_hLib )
{
CString strError;
strError.Format(_T("LoadLibrary failed [%s]; GetLastError[%d];"), strSecuBSPMx, GetLastError());
return false;
}
// Basic Functions
SecuAPI_Init = (FP_SecuAPI_Init) GetProcAddress(m_hLib, "SecuAPI_Init");
SecuAPI_Terminate = (FP_SecuAPI_Terminate) GetProcAddress(m_hLib, "SecuAPI_Terminate");
// Device Functions
SecuAPI_EnumerateDevice = (FP_SecuAPI_EnumerateDevice) GetProcAddress(m_hLib, "SecuAPI_EnumerateDevice");
SecuAPI_OpenDevice = (FP_SecuAPI_OpenDevice) GetProcAddress(m_hLib, "SecuAPI_OpenDevice");
SecuAPI_CloseDevice = (FP_SecuAPI_CloseDevice) GetProcAddress(m_hLib, "SecuAPI_CloseDevice");
// BSP Functions
SecuAPI_Capture = (FP_SecuAPI_Capture) GetProcAddress(m_hLib, "SecuAPI_Capture");
SecuAPI_VerifyMatch = (FP_SecuAPI_VerifyMatch) GetProcAddress(m_hLib, "SecuAPI_VerifyMatch");
SecuAPI_Enroll = (FP_SecuAPI_Enroll) GetProcAddress(m_hLib, "SecuAPI_Enroll");
SecuAPI_Verify = (FP_SecuAPI_Verify) GetProcAddress(m_hLib, "SecuAPI_Verify");
SecuAPI_Init(&m_hBSP);
if (m_hBSP)
return true;
else
return false;
}
Yo trate convertirlo a FWH/Harbour de esta forma, pero me salieron un monto de errores:
- Code: Select all Expand view RUN
#pragma BEGINDUMP
#include <windows.h>
#include "hbapi.h"
#include "stdafx.h"
#include "BSPDemo.h"
#include "BSPDemoDlg.h"
// Initialize variables
static m_hLib = 0;
static m_hBSP = 0;
//-------------------------------------------------------
HB_FUNC( InitSecuBSP )
//bool CBSPDemoDlg::InitSecuBSP()
{
m_hLib = LoadLibrary("SecuBSPMx.dll");
if ( !m_hLib )
{
return false;
}
// Basic Functions
SecuAPI_Init = (FP_SecuAPI_Init) GetProcAddress(m_hLib, "SecuAPI_Init");
SecuAPI_Terminate = (FP_SecuAPI_Terminate) GetProcAddress(m_hLib, "SecuAPI_Terminate");
// Device Functions
SecuAPI_EnumerateDevice = (FP_SecuAPI_EnumerateDevice) GetProcAddress(m_hLib, "SecuAPI_EnumerateDevice");
SecuAPI_OpenDevice = (FP_SecuAPI_OpenDevice) GetProcAddress(m_hLib, "SecuAPI_OpenDevice");
SecuAPI_CloseDevice = (FP_SecuAPI_CloseDevice) GetProcAddress(m_hLib, "SecuAPI_CloseDevice");
// BSP Functions
SecuAPI_Capture = (FP_SecuAPI_Capture) GetProcAddress(m_hLib, "SecuAPI_Capture");
SecuAPI_VerifyMatch = (FP_SecuAPI_VerifyMatch) GetProcAddress(m_hLib, "SecuAPI_VerifyMatch");
SecuAPI_Enroll = (FP_SecuAPI_Enroll) GetProcAddress(m_hLib, "SecuAPI_Enroll");
SecuAPI_Verify = (FP_SecuAPI_Verify) GetProcAddress(m_hLib, "SecuAPI_Verify");
SecuAPI_Init(&m_hBSP);
if (m_hBSP)
return .t.;
else
return .f.;
}
#pragma ENDDUMP
Estos son los errores que obtuve:
- Code: Select all Expand view RUN
Warning W8069 .\\source\\SEM3201.PRG 22927: Nonportable pointer conversion in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22931: Undefined symbol 'false' in function HB_FUN_InitSecuBSP
Warning W8081 .\\source\\SEM3201.PRG 22931: void functions may not return a value in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22935: Undefined symbol 'SecuAPI_Init' in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22935: Undefined symbol 'FP_SecuAPI_Init' in function HB_FUN_InitSecuBSP
Error E2379 .\\source\\SEM3201.PRG 22935: Statement missing ; in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22936: Undefined symbol 'SecuAPI_Terminate' in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22936: Undefined symbol 'FP_SecuAPI_Terminate' in function HB_FUN_InitSecuBSP
Error E2379 .\\source\\SEM3201.PRG 22936: Statement missing ; in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22939: Undefined symbol 'SecuAPI_EnumerateDevice' in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22939: Undefined symbol 'FP_SecuAPI_EnumerateDevice' in function HB_FUN_InitSecuBSP
Error E2379 .\\source\\SEM3201.PRG 22939: Statement missing ; in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22940: Undefined symbol 'SecuAPI_OpenDevice' in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22940: Undefined symbol 'FP_SecuAPI_OpenDevice' in function HB_FUN_InitSecuBSP
Error E2379 .\\source\\SEM3201.PRG 22940: Statement missing ; in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22941: Undefined symbol 'SecuAPI_CloseDevice' in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22941: Undefined symbol 'FP_SecuAPI_CloseDevice' in function HB_FUN_InitSecuBSP
Error E2379 .\\source\\SEM3201.PRG 22941: Statement missing ; in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22944: Undefined symbol 'SecuAPI_Capture' in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22944: Undefined symbol 'FP_SecuAPI_Capture' in function HB_FUN_InitSecuBSP
Error E2379 .\\source\\SEM3201.PRG 22944: Statement missing ; in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22945: Undefined symbol 'SecuAPI_VerifyMatch' in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22945: Undefined symbol 'FP_SecuAPI_VerifyMatch' in function HB_FUN_InitSecuBSP
Error E2379 .\\source\\SEM3201.PRG 22945: Statement missing ; in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22946: Undefined symbol 'SecuAPI_Enroll' in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22946: Undefined symbol 'FP_SecuAPI_Enroll' in function HB_FUN_InitSecuBSP
Error E2379 .\\source\\SEM3201.PRG 22946: Statement missing ; in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22947: Undefined symbol 'SecuAPI_Verify' in function HB_FUN_InitSecuBSP
Error E2451 .\\source\\SEM3201.PRG 22947: Undefined symbol 'FP_SecuAPI_Verify' in function HB_FUN_InitSecuBSP
Error E2379 .\\source\\SEM3201.PRG 22947: Statement missing ; in function HB_FUN_InitSecuBSP
Error E2188 .\\source\\SEM3201.PRG 22952: Expression syntax in function HB_FUN_InitSecuBSP
Warning W8081 .\\source\\SEM3201.PRG 22952: void functions may not return a value in function HB_FUN_InitSecuBSP
Error E2188 .\\source\\SEM3201.PRG 22954: Expression syntax in function HB_FUN_InitSecuBSP
Warning W8081 .\\source\\SEM3201.PRG 22954: void functions may not return a value in function HB_FUN_InitSecuBSP
Podría alguien ayudarme a trasaladar el codigo de C++ a FWH por favor, gracias.
Saludos cordiales.
Carlos Sincuir