FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour New FWH 17.01
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: New FWH 17.01
Posted: Tue Jan 31, 2017 06:18 PM
To be more explicit, these are the two C functions that I would move from checkres.prg to resource.c:

Code (fw): Select all Collapse
void RegisterResource( HANDLE hRes, LPSTR szType )
{
   PHB_ITEM pRet = hb_itemNew( hb_param( -1, HB_IT_ANY ) );

   hb_vmPushSymbol( hb_dynsymGetSymbol( "FWADDRESOURCE" ) );
   hb_vmPushNil();
   #ifndef _WIN64   
      hb_vmPushLong( ( LONG ) hRes );
   #else   
      hb_vmPushSize( ( HB_ISIZ ) hRes );
   #endif   
   hb_vmPushString( szType, strlen( szType ) );
   hb_vmFunction( 2 );

   hb_itemReturnRelease( pRet );
}  

void pascal DelResource( HANDLE hResource )
{
   PHB_ITEM pRet = hb_itemNew( hb_param( -1, HB_IT_ANY ) );

   hb_vmPushSymbol( hb_dynsymGetSymbol( "FWDELRESOURCE" ) );
   hb_vmPushNil();
   #ifndef _WIN64   
      hb_vmPushLong( ( LONG ) hResource );
   #else   
      hb_vmPushSize( ( HB_ISIZ ) hResource );
   #endif   
   hb_vmFunction( 1 );

   hb_itemReturnRelease( pRet );
}


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: New FWH 17.01
Posted: Tue Jan 31, 2017 06:34 PM

Enrico,

Consider that we move those functions to resource.c and that checkres.prg is not linked in the final EXE

In such case the app will try to execute two PRG functions that do not exist, thus generating an error.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: New FWH 17.01
Posted: Tue Jan 31, 2017 06:51 PM

Ok, now I understood. I didn't see that the C functions are calling PRG functions.

EMG

Continue the discussion