Erro * Symbol item expected from hb_vbDo()

Erro * Symbol item expected from hb_vbDo()

Postby lailton.webmaster » Fri Oct 23, 2009 5:48 pm

Symbol item expected from hb_vbDo()

yo posso hacer algo para cuando der este erro return NIL i no feche meu sistema ?
Last edited by lailton.webmaster on Sun Oct 25, 2009 11:42 am, edited 2 times in total.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Erro

Postby Antonio Linares » Fri Oct 23, 2009 6:47 pm

Lailton,

Con que código PRG generas ese error ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Erro

Postby lailton.webmaster » Fri Oct 23, 2009 7:04 pm

Con biometria, funciona pero algunas vezes cuando captura la digital me ocorre este erro.
y fecha meu sistema.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Erro

Postby lailton.webmaster » Sat Oct 24, 2009 6:00 am

Antonio, yo gostaria de hacer alguna cosa assi

viewtopic.php?p=86134#p86134

pero para lo erro "Symbol item expected from hb_vbDo()"
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Erro

Postby Antonio Linares » Sat Oct 24, 2009 6:36 am

Lailton,

No es posible. Ese es un error interno que se genera porque los símbolos en la pila de la maquina virtual no estan bien puestos. No hay solución a eso.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Erro

Postby lailton.webmaster » Sun Oct 25, 2009 2:57 am

Solved. ! thanks.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Erro _Solved

Postby Antonio Linares » Sun Oct 25, 2009 11:27 am

Lailton,

Posiblemente estabas saltando a nivel PRG desde nivel C, y no estabas construyendo bien la pila de la máquina virtual
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Erro _Solved

Postby lailton.webmaster » Sun Oct 25, 2009 11:34 am

bien no achei solucion para lo erro, pero yo fiz la parte de biometria
en um EXE externo em Visual Basic.
ate achar donde estas lo problema. voy providenciar una pasta com lo prg caso tu tienã cono ajudar
a procurar lo problema.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Erro * Symbol item expected from hb_vbDo()

Postby lailton.webmaster » Sun Oct 25, 2009 11:45 am

Arquivo .c que ocorre lo erro:

Erro es : "Symbol item expected from hb_vbDo()"

Funciona bien, pero as vezes ocorre lo erro.

Code: Select all  Expand view
#define HB_OS_WIN_32_USED

#include <windows.h>
#include "hbapi.h"
#include "MsFinger.h"

static PHB_DYNS pEventStatus = NULL;
static PHB_DYNS pEventImage  = NULL;

static
PHB_DYNS FindSymbol( char * cFuncName )
{
   PHB_DYNS p = hb_dynsymFindName(cFuncName);
   if  ( !p )
   {
      char err[255] = {0};
      sprintf( err, "FindSymbol: Undefined symbol '\%s' unable to continue!", cFuncName );
      hb_errInternal( 7042, err, "", "" );
   }
   return p;
}

static
void PushSymbol( PHB_DYNS pPointer )
{
#if defined(HB_NEW_PUSH_SYMBOL)
      hb_vmPushSymbol( hb_dynsymSymbol( pPointer ) );
#else
      hb_vmPushSymbol( pPointer->pSymbol );
#endif
}

static
void WriteEvent(char *idSensor, int event)
{
   PushSymbol(pEventStatus);
   hb_vmPushNil();
   hb_vmPushInteger(event);
   hb_vmPushString( idSensor, strlen(idSensor) );
   hb_vmDo( 2 );
}

static
void WriteLog(char *msg)
{
   PushSymbol(pEventStatus);
   hb_vmPushNil();
   hb_vmPushInteger( GR_LOG );
   hb_vmPushString( msg, strlen(msg) );
   hb_vmDo( 2 );
}

static
void CALLBACK FingerEventHandler(char* idSensor, GRCAP_FINGER_EVENTS event)
{
    WriteLog("Just signals that a finger event ocurred.");
    WriteEvent(idSensor, event);
}

static
void CALLBACK ImageEventHandler(char* idSensor, unsigned int width, unsigned int height, unsigned char* rawImage, int res)
{
   PHB_ITEM pImage;
   PHB_ITEM pTemplate;
   
   char tpt[GR_MAX_SIZE_TEMPLATE];
   int Ret, Size;
   
    WriteLog("Signaling that an image event occurred.");

  Size = GR_MAX_SIZE_TEMPLATE;
  Ret  = GrExtract( rawImage, width, height, res, tpt, &Size, GR_DEFAULT_CONTEXT );
 
  if (Ret < 0 )
     Size = 0;
   
   pImage = hb_itemNew( NULL );
   hb_itemPutCL( pImage, rawImage, width*height );

   pTemplate = hb_itemNew( NULL );
   
   if (Size)
   {
      hb_itemPutCL( pTemplate, (char *)tpt, Size );
   } else {
      hb_itemPutC( pTemplate, "" );
   }
   
   PushSymbol(pEventImage);
   hb_vmPushNil();
   hb_vmPushString( idSensor, strlen(idSensor) );
   hb_vmPush( pTemplate );
   hb_vmPush( pImage );
   hb_vmPushLong( (LONG) width );
   hb_vmPushLong( (LONG) height );
   hb_vmPushInteger( res );
   hb_vmDo( 6 );
   
   hb_itemRelease( pImage );
   hb_itemRelease( pTemplate );
}

static
void CALLBACK StatusEventHandler(char* idSensor, GRCAP_STATUS_EVENTS event)
{  
   WriteEvent( idSensor, event );
   
    if (event == GR_PLUG)
   {
      WriteLog("Start capturing from plugged sensor.");
        GrCapStartCapture(idSensor, &FingerEventHandler, &ImageEventHandler);
    } else if (event == GR_UNPLUG)
   {
      WriteLog("Stop capturing from unplugged sensor.");
        GrCapStopCapture(idSensor);
    }
}

//############################################################################//
static
void GrInitalizeSymbols()
{
   pEventStatus = FindSymbol( "GR_STATUSEVENTHANDLER" );
   pEventImage  = FindSymbol( "GR_IMAGEEVENTHANDLER" );
}

HB_FUNC( GRINITIALIZE )
{
   if (!pEventStatus)
       GrInitalizeSymbols();
       
   hb_retni( GrInitialize() );
}

HB_FUNC( GRFINALIZE )
{
   hb_retni( GrFinalize() );
}

HB_FUNC( INITIALIZEGRCAP )
{
  hb_retni( GrCapInitialize(&StatusEventHandler) );
}

HB_FUNC( GRCAPFINALIZE )
{
  hb_retni( GrCapFinalize() );
}

HB_FUNC( GRIDENTIFYPREPARE )
{
   char *templateQuery = hb_parc(1);
   int context = hb_parni(1);
   
   hb_retni( GrIdentifyPrepare(templateQuery, context) );
}

HB_FUNC( GRIDENTIFY )
{
   char *templateReference = hb_parc(1);
   int identifyScore = hb_parni(2);
   int context = hb_parni(3);
   
   hb_retni( GrIdentify (templateReference, &identifyScore, context ));  
   hb_storni( identifyScore, 2 );
}

HB_FUNC( GRVERIFY )
{
   char *queryTemplate = hb_parc(1);
   char *referenceTemplate = hb_parc(2);
   int verifyScore = hb_parni(3);         // by reference - @  
   int context = hb_parni(4);

   hb_retni( GrVerify(queryTemplate, referenceTemplate, &verifyScore, context) );
   hb_storni( verifyScore, 3 );
}

HB_FUNC( GRCAPSAVERAWIMAGETOFILE )
{
   unsigned char* rawImage = (unsigned char*) hb_parc(1);
   unsigned int width  = (unsigned int) hb_parnl(2);
   unsigned int height = (unsigned int) hb_parnl(3);
   char* fileName = hb_parc(4);
   GRCAP_IMAGE_FORMAT imageFormat = ( ISNUM(5) ? hb_parni(5) : 501 );
   
   hb_retni( GrCapSaveRawImageToFile(rawImage, width, height, fileName, imageFormat) );
}
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Erro * Symbol item expected from hb_vbDo()

Postby lailton.webmaster » Sun Oct 25, 2009 11:45 am

MsFinger.h

Code: Select all  Expand view
 /******************************************************
   *                                                    *
   *       GrFinger Biometric Fingerprint Library       *
   *                                                    *
   *                                                    *
   ******************************************************/


   #include "windows.h"
   #include "MsFinger.ch"
   
   #define DLLIMPORT __declspec(dllimport) int __stdcall
   #define CALLBACK __stdcall
   
   typedef int GRCAP_STATUS_EVENTS;
   typedef int GRCAP_FINGER_EVENTS;
   typedef int GRCAP_IMAGE_FORMAT;
   typedef long BITMAP_HANDLE;
   
   typedef void CALLBACK GRCAP_STATUS_EVENT_PROC(char* idSensor, GRCAP_STATUS_EVENTS event);
   typedef void CALLBACK GRCAP_FINGER_EVENT_PROC(char* idSensor, GRCAP_FINGER_EVENTS event);
   typedef void CALLBACK GRCAP_IMAGE_EVENT_PROC(char* idSensor, unsigned int width, unsigned int height, unsigned char* rawImage, int res);
   
   DLLIMPORT
   GrCapInitialize(GRCAP_STATUS_EVENT_PROC *StatusEventHandler);
   DLLIMPORT
   GrCapFinalize();
   DLLIMPORT
   GrCapStartCapture(char* idSensor, GRCAP_FINGER_EVENT_PROC *FingerEventHandler, GRCAP_IMAGE_EVENT_PROC *ImageEventHandler);
   DLLIMPORT
   GrCapStopCapture(char* idSensor);
   DLLIMPORT
   GrExtract(unsigned char *rawimage, int width, int height, int res, char *tpt, int *tptSize, int context);
   DLLIMPORT
   GrInitialize();
   DLLIMPORT
   GrFinalize();
   DLLIMPORT
   GrVerify(char *queryTemplate, char *referenceTemplate, int *verifyScore, int context);
   DLLIMPORT
   GrIdentifyPrepare (char *templateQuery, int context);
   DLLIMPORT
   GrIdentify(char *templateReference, int *identifyScore, int context);
   DLLIMPORT
   GrCapSaveRawImageToFile(unsigned char* rawImage, unsigned int width, unsigned int height, char* fileName, GRCAP_IMAGE_FORMAT imageFormat);
 
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 54 guests