Joaquín,
Habría que añadir el módulo checkres.prg de FWH a FWPPC.
Aqui tienes el código
Code: Select all
#include "FiveWin.ch"
static aResources := {}
//----------------------------------------------------------------------------//
function SetResDebug( lOnOff ) // for backwards compatibility
return nil
//----------------------------------------------------------------------------//
function FWAddResource( nHResource, cType )
local n := 3, cInfo := ""
while ! Empty( ProcName( n ) )
cInfo += ProcName( n ) + "(" + Alltrim( Str( ProcLine( n ) ) ) + ")->"
n++
end
if ! Empty( cInfo )
cInfo = SubStr( cInfo, 1, Len( cInfo ) - 2 )
endif
AAdd( aResources, { cType, nHResource, cInfo } )
return nil
//----------------------------------------------------------------------------//
function FWDelResource( nHResource )
local nAt
if ( nAt := AScan( aResources, { | aRes | aRes[ 2 ] == nHResource } ) ) != 0
ADel( aResources, nAt )
ASize( aResources, Len( aResources ) - 1 )
endif
return nil
//----------------------------------------------------------------------------//
function CheckRes()
local cInfo := "", n
for n = 1 to Len( aResources )
if aResources[ n, 2 ] != 0
cInfo = GetModuleFileName( GetInstance() ) + " -- " + ;
aResources[ n, 1 ] + "," + AllTrim( Str( aResources[ n, 2 ] ) ) + ;
"," + aResources[ n, 3 ] + CRLF
LogFile( "checkres.txt", { cInfo } )
endif
next
LogFile( "checkres.txt", { GetModuleFileName( GetInstance() ) + " -- " + ;
Replicate( "=", 100 ) } )
return nil
//---------------------------------------------------------------------------//
#pragma BEGINDUMP
#include <windows.h>
#include <hbapiitm.h>
#include <hbvm.h>
void RegisterResource( HANDLE hRes, LPSTR szType )
{
PHB_ITEM pRet = hb_itemNew( hb_param( -1, HB_IT_ANY ) );
hb_vmPushSymbol( hb_dynsymGetSymbol( "FWADDRESOURCE" ) );
hb_vmPushNil();
hb_vmPushLong( ( LONG ) hRes );
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();
hb_vmPushLong( ( LONG ) hResource );
hb_vmFunction( 1 );
hb_itemReturnRelease( pRet );
}
#pragma ENDDUMP
//----------------------------------------------------------------------------//