I searched all files in contrib, there is no example anywhere that points to my example and function hb_evalBlock0 there is no such.
This is exactly what it looks like:
``` C executable file
int main( int* argc, char** argv )
{
udxInitialize( &argc, argv )
udxDisplayFunc( display );
/* udxLoop() calls the application's appropriate callbacks, polls the data entry devices car inspections. */
udxLoop( )
return 0;
}
static void display( void )
{
printf( "Sample data to display\n" );
}
```
This is the minimum to check registration in C
``` (x)Harbour executable file
function Main()
udxInitialize( 0, NIL )
udxDisplayFunc( {|| display() } )
udxLoop()
return nil
function display()
? "Sample data to display"
return nil
```
``` (x)Harbour c file
HB_FUNC( UDXINITIALIZE )
{
/*
int argc = hb_parni( 1 );
udxInitialize( &argc, hb_parc( 2 ) );
hb_ret();
the above makes a mistake so I shortened it to this option */
udxInitialize( 0, NULL )
}
PHB_ITEM pBlock = NULL;
static void display( void )
{
/* This condition is not executed and it skips the hb_evalBlock0 */function
if( pBlock && HB_IS_BLOCK( pBlock ) )
hb_evalBlock0( pBlock );
}
/* UDXAPI void udxDisplayFunc( void ( * callback )( void ) ); */
HB_FUNC( UDXDISPLAYFUNC )
{
pBlock = hb_param( 1, HB_IT_SYMBOL );
udxDisplayFunc( display );
}
/* UDXAPI void udxLoop( void ) */
HB_FUNC( UDXLOOP )
{
udxLoop();
}
``` The End
It's really strange that no one did this in Contrib ?
Thank you for your help.