FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Ayuda con codigo C
Posts: 476
Joined: Sat Feb 03, 2007 06:36 AM
Ayuda con codigo C
Posted: Thu Mar 11, 2021 12:13 AM
Hola a todos.
Quiero molestarles ahora, si alguien sabe como poder usar este codigo C con FWH por favor:

Code (fw): Select all Collapse
--------------------------------------------------------------
| Codigo para lectura / registro de la huella
|
--------------------------------------------------------------

#include <iostream>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <fstream>

using namespace std;

int main(int argc, char *argv[])
{
    string resultado = "";

    if(argc==1)
    {
        resultado = system("biometrico\\bspdemo_cs.exe  adndigital2021");
        ifstream file("biometrico\\biometricohuella.txt");
        string content;

        //--------------------------------------
        // Lee el resultado del archivo
        // La huella leida por el biometrico
        //--------------------------------------
        while(file >> content)
        {
            cout << content << ' ';
        }

    }

    return 0;
}


--------------------------------------------------------------
| Codigo para comparar la huella contra una ya registrada
|
--------------------------------------------------------------

#include <iostream>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <fstream>

using namespace std;

int main(int argc, char *argv[])
{
    string resultado = "";

    if(argc==2)
    {
        std::string cmd = "biometrico\\bspdemo_cs.exe  adndigital2021";

        //
        // argv[1] --> contiene el string de la huella a comparar
        //
        cmd += argv[1];

        resultado = system(cmd.c_str());

        ifstream file("biometrico\\biometricoresultado.txt"); string content;

        //--------------------------------------
        // Lee el resultado del archivo
        // Matched
        // Not Matched
        //--------------------------------------
        while(file >> content)
        {
            cout << content << ' ';
        }
    }

    return 0;
}


Gracias anticipadas.

Carlos
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda con codigo C
Posted: Thu Mar 11, 2021 08:04 AM

Carlos,

Prueba asi:

WinExec( "biometrico\bspdemo_cs.exe adndigital2021" )
MsgInfo( MemoRead( "biometrico\biometricohuella.txt" ) )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 476
Joined: Sat Feb 03, 2007 06:36 AM
Re: Ayuda con codigo C
Posted: Thu Mar 11, 2021 12:20 PM

Antonio, gracias por tu respuesta.
Yo hago las pruebas y comento luego.
Este es un requerimiento de un cliente, que quiere utilizar los lectores biométricos Hamster IV

Saludos cordiales.

Carlos

Continue the discussion