New FWH 17.01

Re: New FWH 17.01

Postby Enrico Maria Giordano » Tue Jan 31, 2017 6:18 pm

To be more explicit, these are the two C functions that I would move from checkres.prg to resource.c:

Code: Select all  Expand view
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
User avatar
Enrico Maria Giordano
 
Posts: 8522
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: New FWH 17.01

Postby Antonio Linares » Tue Jan 31, 2017 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41858
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: New FWH 17.01

Postby Enrico Maria Giordano » Tue Jan 31, 2017 6:51 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8522
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 86 guests