FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Erro * Symbol item expected from hb_vbDo()
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Erro * Symbol item expected from hb_vbDo()
Posted: Fri Oct 23, 2009 05:48 PM

Symbol item expected from hb_vbDo()

yo posso hacer algo para cuando der este erro return NIL i no feche meu sistema ?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Erro
Posted: Fri Oct 23, 2009 06:47 PM

Lailton,

Con que código PRG generas ese error ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Erro
Posted: Fri Oct 23, 2009 07:04 PM

Con biometria, funciona pero algunas vezes cuando captura la digital me ocorre este erro.
y fecha meu sistema.

Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Erro
Posted: Sat Oct 24, 2009 06: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()"

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Erro
Posted: Sat Oct 24, 2009 06: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
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Erro
Posted: Sun Oct 25, 2009 02:57 AM

Solved. ! thanks.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Erro _Solved
Posted: 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
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Erro _Solved
Posted: 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.

Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Erro * Symbol item expected from hb_vbDo()
Posted: 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 (fw): Select all Collapse
#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) );
}
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Erro * Symbol item expected from hb_vbDo()
Posted: Sun Oct 25, 2009 11:45 AM
MsFinger.h

Code (fw): Select all Collapse
  /******************************************************
   *                                                    *
   *       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);

Continue the discussion