Griaule Biometrics

Home » Forums » FINGERPRINT SDK » C/C++ Specific » Using C/C++ API
1 reply [Last post]
jlome
Offline
Joined: 2008-10-25
Rate this post:
0
No votes yet
Using C/C++ API

Hi,

I'm trying to use Fingerprint SDK 2007 to do a DLL that can get and/or verify a fingerprint.

My environment is:
Windows Vista Business
Visual Studio 2005
Fingerprint SDK 2007
Nitgen Model: HFDU 04 device

I'm having a problem is that a I can't to get a fingerprint.

In FK_Init function I call GrInitialize() and GrCapInitialize() the return code on both is ok.
An event GR_PLUG occur once and call GrCapStartCapture, but after this the program end normally..

What I'm doing wrong ?

Do I need to do some loop to take the fingerprint ?

Do I need do call GrCreateContext ? On samples don't use it, but in documentation Applications Overview it's showed in the flow..

My basic code is this:

void WINAPI StatusEventHandler(char* idSensor, GRCAP_STATUS_EVENTS event) {
// Signaling that a status event occurred.
UINT err = 0;
if (event == GR_PLUG) {
// Start capturing from plugged sensor.
err = GrCapStartCapture(idSensor, FingerEventHandler, ImageEventHandler);
} else if (event == GR_UNPLUG) {
// Stop capturing from unplugged sensor
err = GrCapStopCapture(idSensor);
}
}

// Consumes data that came from finger event.
void WINAPI FingerEventHandler(char* idSensor, GRCAP_FINGER_EVENTS event) {
// Just signals that a finger event ocurred.
char msg[1024];
if(event == GR_FINGER_DOWN)
{
sprintf(msg, "%s%s.","","-2");
return;
}
else //GR_FINGER_UP:
{
sprintf(msg, "%s%s.","","-3");
return;
}
}

// Consumes data that came from an image event.
void WINAPI ImageEventHandler(char* idSensor, unsigned int width, unsigned int height, unsigned char* rawImage, int res) {
// Copying aquired image
int h = height;
int w = width;

return;
}

int FK_Init(bool bUseDevice)
{
char msg[512];
int iRet = 0;
int contextId = NULL;

iRet = GrInitialize();
if ( iRet != GR_OK )
{
sprintf(msg, "Falhou inicialização do dispositivo da impressão digital. ERROR (%d)", iRet);
iRet = -1;
}

iRet = GrCreateContext(&contextId); // Do I need to do this ?

iRet = GrCapInitialize(StatusEventHandler);

return iRet;
}

Thanks

Fabio Garbin

davi.st1
Offline
Joined: 2010-08-26
Rate this post:
0
No votes yet

Dear customer,

 

download our sample and take a look at our code.

You find how to implement the code.

 

Did you try to read our DLL manual? There is a lot of things explained.

 

If the problem persists, don't hesitate to contact us.

 

-------------------------------------------

Davi Stuart Zilli

Griaule Support Team