Enrique, Antonio, gracias por sus respuestas.
Antonio, he enlazado la librer铆a que me comentas y ya no me marca error al compilar
, pero (ojala nu hubiera un pero) ahora me marca un erro de que mi PRG fue creado con el PCODE versi贸n 7 (Algo antigua jejeje) y que xHarbour espera la versi贸n 10.
Me pus茅 a buscar en el foro y encontr茅 esto:
La pregunta es 驴Donde debo poner este c贸digo? Dentro de mi prg principal?. Perd贸n por la ignorancia pero prefiero preguntar antes de regarla mas.
Saludos y gracias nuevamente
Antonio, he enlazado la librer铆a que me comentas y ya no me marca error al compilar
Me pus茅 a buscar en el foro y encontr茅 esto:
by Antonio Linares 禄 08 Sep 2009, 10:56
This is a better hack as it processes internal errors and just avoid the pcode version error. It is the same code used in xHarbour with a little modification:
#pragma BEGINDUMP
#include "hbapifs.h"
#include "hbapilng.h"
#include <windows.h>
void hb_errInternal( ULONG ulIntCode, const char * szText, const char * szPar1, const char * szPar2 )
{
聽 聽char title[64], buffer[ 1024 ];
聽 聽FILE *fpError;
聽 聽BOOL bLang;
聽 聽HB_TRACE(HB_TR_DEBUG, ("hb_errInternal(%lu, %s, %s, %s)", ulIntCode, szText, szPar1, szPar2));
聽 聽if( strncmp( szText, "Module:", 7 ) == 0 ) // pcode version
聽 聽 聽 return;
聽 聽bLang = ( hb_langID() != NULL );
聽 聽if( szText )
聽 聽{
聽 聽 聽 fpError = hb_fopen( "error.log", "a" );
聽 聽 聽 if( fpError )
聽 聽 聽 {
聽 聽 聽 聽 聽fclose( fpError );
聽 聽 聽 聽 聽TraceLog( "error.log", szText, szPar1, szPar2 );
聽 聽 聽 }
聽 聽}
聽 聽hb_conOutErr( hb_conNewLine(), 0 );
聽 聽hb_snprintf( title, sizeof( title ), bLang ?
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR ) :
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "Unrecoverable error %lu: ", ulIntCode );
聽 聽hb_conOutErr( title, 0 );
聽 聽if( szText != NULL )
聽 聽{
聽 聽 聽 hb_snprintf( buffer, sizeof( buffer ), szText, szPar1, szPar2 );
聽 聽}
聽 聽else if (bLang)
聽 聽{
聽 聽 聽 hb_snprintf( buffer, sizeof( buffer ), ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR + ulIntCode - 9000 ), szPar1, szPar2 );
聽 聽}
聽 聽hb_conOutErr( buffer, 0 );
聽 聽hb_conOutErr( hb_conNewLine(), 0 );
聽 聽hb_stackDispCall();
聽 聽#ifdef HB_OS_WIN_32
聽 聽 聽 MessageBox( NULL, buffer, title, MB_ICONSTOP );
聽 聽#endif
聽 聽/* release console settings */
聽 聽hb_conRelease();
聽 聽if( hb_cmdargCheck( "ERRGPF" ) )
聽 聽{
聽 聽 聽 聽int *pGPF = NULL;
聽 聽 聽 聽*pGPF = 0;
聽 聽 聽 聽*(--pGPF) = 0;
聽 聽}
聽 聽#if defined( HB_THREAD_SUPPORT ) && defined( HB_OS_OS2 )
聽 聽 聽 /* Post all threads waiting on an indefinite wait */
聽 聽 聽 DosPostEventSem(hb_hevWakeUpAll);
聽 聽 聽 /* Let's give them some time to wake up */
聽 聽 聽 DosSleep(5000);
聽 聽 聽 /* Stop VM, I cannot call exit() here or I end up with a zombie process */
聽 聽 聽 hb_vmQuit();
聽 聽#endif
聽 聽exit( EXIT_FAILURE );
}
#pragma ENDDUMP
聽
This is the only change in it:
Code: Select all 聽Expand view
聽 聽if( strncmp( szText, "Module:", 7 ) == 0 ) // pcode version
聽 聽 聽 return;
聽regards, saludosLa pregunta es 驴Donde debo poner este c贸digo? Dentro de mi prg principal?. Perd贸n por la ignorancia pero prefiero preguntar antes de regarla mas.
Saludos y gracias nuevamente