FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Error Dialog? ( Solved! )
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Re: Error Dialog?
Posted: Thu Jan 08, 2009 07:50 PM
Is done and with the default bat compiler it's ok!

My list of libraries, all in order of use
FiveHx.lib FiveHC.lib +
rtl.lib +      
vm.lib +       
gtgui.lib + 
lang.lib +     
macro.lib +    
rdd.lib +      
codepage.lib + 
dbfntx.lib +   
dbfcdx.lib +   
dbffpt.lib +   
hbsix.lib +    
common.lib +   
pp.lib +       
"C:\apps\libs\libmysql.lib" +  
"C:\apps\libs\sqllib_xHB_110g.LIB" +  
"H:\xHarbour\lib\zlib.lib" +  
"H:\xHarbour\lib\ct.lib" +  
"H:\xHarbour\lib\hbcc.lib" +  
"H:\xHarbour\lib\hsx.lib" +  
"H:\xHarbour\lib\tip.lib" +  
"H:\xHarbour\lib\codepage.lib" +  
"H:\xHarbour\lib\pcrepos.lib" +  
"H:\BCC55\Lib\PSDK\msimg32.lib" +  
"H:\BCC55\Lib\PSDK\url.lib" +  
cw32.lib +     
import32.lib + 
odbc32.lib +
nddeapi.lib +
iphlpapi.lib +
rasapi32.lib +


Please Antonio, what you need to help me about this?
I tried to show a message with msgInfo( "test" ) at the first lines of errorDialog() and don't show! I think if is possible to not passing by the errorDialog() function?
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error Dialog?
Posted: Thu Jan 08, 2009 08:02 PM
Julio,

Lets check where Alert() is getting called from your app. Please try this code:
#include "FiveWin.ch"

function Main()

   local oError := ErrorNew( "A test" )

   Eval( ErrorBlock(), oError )

return nil

function Alert()

   x++    // a recursive error should happen here

return nil

Please post here the error.log that you get
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Re: Error Dialog?
Posted: Thu Jan 08, 2009 08:03 PM

I will try your test, but first... look this:
I tried to show a message with msgInfo( "test" ) at the first lines of errorDialog() and don't show! I think if is possible to not passing by the errorDialog() function?

Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Re: Error Dialog?
Posted: Thu Jan 08, 2009 08:06 PM

The result:

A error message titled with "Unrecoverable error 9003:", "Too many recursive error handler calls"
And this not generated a error.log file... What (???)

Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Re: Error Dialog?
Posted: Thu Jan 08, 2009 08:13 PM
Antonio, I think this may be the cause of the problem

This command to remove the errsysw.obj of lib of fivewin and let only the obj of my application:
H:\BCC55\bin\tlib H:\FWH\lib\fivehx.lib -errsysw.OBJ
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error Dialog?
Posted: Thu Jan 08, 2009 08:47 PM

Júlio,

Is the FWH error dialog properly shown or not ?

Please build the example that I posted before, so we will know more about what is going on

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Re: Error Dialog?
Posted: Thu Jan 08, 2009 08:59 PM
>> Is the FWH error dialog properly shown or not ?

Apparently not! Is a alert message of error

>> Please build the example that I posted before, so we will know more about what is going on

With the default configs of FWH:

and error.log
Application
===========
   Path and name: H:\apps\FWH8.10\FWH\samples\jc.exe (32 bits)
   Size: 1,377,792 bytes
   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 01/08/09, 17:53:19
   Error description: Error A test/0  

Stack Calls
===========
   Called from: jc.prg => MAIN(7)

System
======
   CPU type:               Intel(R) Pentium(R) D CPU 2.80GHz 2800 Mhz
   Hardware memory: 1014 megs

   Free System resources: 90 %
        GDI    resources: 90 %
        User   resources: 90 %

   Compiler version: xHarbour build 1.1.0 Intl. (SimpLex) (Rev. 6195)
   Windows version: 5.1, Build 2600 Service Pack 3

   Windows total applications running: 0

Variables in use
================
   Procedure     Type   Value
   ==========================
   MAIN
     Local   1:    O    Class: ERROR

Linked RDDs
===========
   DBF
   DBFFPT
   DBFBLOB
   DBFNTX

DataBases in use
================

Classes in use:
===============
     1 HASHENTRY
     2 HBCLASS
     3 ERROR
     4 HBOBJECT
     5 TREG32

Memory Analysis
===============
      96 Static variables

   Dynamic memory consume:
      Actual  Value:          0 bytes
      Highest Value:          0 bytes


--
With my app:

and no have a error.log
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error Dialog?
Posted: Thu Jan 08, 2009 09:04 PM
Julio,

>
With the default configs of FWH:

>

That is ok.

So it means that you are changing the ErrorSys somewhere in your application.
Are you using a modified ErrSysW.prg ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Re: Error Dialog?
Posted: Thu Jan 08, 2009 11:27 PM
>> So it means that you are changing the ErrorSys somewhere in your application.
>> Are you using a modified ErrSysW.prg ?

Yes Antonio! Just adding this function below:
    && ------------------------------
    FUNCTION gpfHandler( oException )
    && ------------------------------

    LOCAL oError

    LOCAL cMensagemErro := ""
    LOCAL nCodigoErro   := 0


    && -- Verificando se oException é um objeto para iniciar o tratamento
    IF typeCheck( oException, "O" )

       nCodigoErro := oException:ExceptionRecord:ExceptionCode

       && -- Verificando qual tipo de exceção foi levantada
       SWITCH nCodigoErro

              CASE EXCEPTION_ACCESS_VIOLATION
                   cMensagemErro := "EXCEPTION_ACCESS_VIOLATION - O thread tentou ler/escrever num endereço virtual ao qual não tinha acesso."
                   EXIT

              CASE EXCEPTION_DATATYPE_MISALIGNMENT
                   cMensagemErro := "EXCEPTION_DATATYPE_MISALIGNMENT - O thread tentou ler/escrever dados desalinhados em hardware que não oferece alinhamento. Por exemplo, valores de 16 bits precisam ser alinhados em limites de 2 bytes; valores de 32 bits em limites de 4 bytes, etc. "
                   EXIT

              CASE EXCEPTION_ARRAY_BOUNDS_EXCEEDED
                   cMensagemErro := "EXCEPTION_ARRAY_BOUNDS_EXCEEDED - O thread tentou acessar um elemento de array fora dos limites e o hardware possibilita a checagem de limites."
                   EXIT

              CASE EXCEPTION_FLT_DENORMAL_OPERAND
                   cMensagemErro := "EXCEPTION_FLT_DENORMAL_OPERAND - Um dos operandos numa operação de ponto flutuante está desnormatizado. Um valor desnormatizado é um que seja pequeno demais para poder ser representado no formato de ponto flutuante padrão."
                   EXIT

              CASE EXCEPTION_FLT_DIVIDE_BY_ZERO
                   cMensagemErro := "EXCEPTION_FLT_DIVIDE_BY_ZERO - O thread tentou dividir um valor em ponto flutuante por um divisor em ponto flutuante igual a zero."
                   EXIT

              CASE EXCEPTION_FLT_INEXACT_RESULT
                   cMensagemErro := "EXCEPTION_FLT_INEXACT_RESULT - O resultado de uma operação de ponto flutuante não pode ser representado como uma fração decimal exata."
                   EXIT

              CASE EXCEPTION_FLT_INVALID_OPERATION
                   cMensagemErro := "EXCEPTION_FLT_INVALID_OPERATION - Qualquer operação de ponto flutuante não incluída na lista."
                   EXIT

              CASE EXCEPTION_FLT_OVERFLOW
                   cMensagemErro := "EXCEPTION_FLT_OVERFLOW - O expoente de uma operação de ponto flutuante é maior que a magnitude permitida pelo tipo correspondente."
                   EXIT

              CASE EXCEPTION_FLT_STACK_CHECK
                   cMensagemErro := 'EXCEPTION_FLT_STACK_CHECK - A pilha ficou desalinhada ("estourou" ou "ficou abaixo") como resultado de uma operação de ponto flutuante.'
                   EXIT

              CASE EXCEPTION_FLT_UNDERFLOW
                   cMensagemErro := "EXCEPTION_FLT_UNDERFLOW - O expoente de uma operação de ponto flutuante é menor que a magnitude permitida pelo tipo correspondente."
                   EXIT

              CASE EXCEPTION_INT_DIVIDE_BY_ZERO
                   cMensagemErro := "EXCEPTION_INT_DIVIDE_BY_ZERO - O thread tentou dividir um valor inteiro por um divisor inteiro igual a zero."
                   EXIT

              CASE EXCEPTION_INT_OVERFLOW
                   cMensagemErro := "EXCEPTION_INT_OVERFLOW - O resultado de uma operação com inteiros causou uma transposição (carry) além do bit mais significativo do resultado."
                   EXIT

              CASE EXCEPTION_PRIV_INSTRUCTION
                   cMensagemErro := "EXCEPTION_PRIV_INSTRUCTION - O thread tentou executar uma instrução cuja operação não é permitida no modo de máquina atual."
                   EXIT

              CASE EXCEPTION_IN_PAGE_ERROR
                   cMensagemErro := "EXCEPTION_IN_PAGE_ERROR - O thread tentou acessar uma página que não estava presente e o sistema não foi capaz de carregar a página. Esta exceção pode ocorrer, por exemplo, se uma conexão de rede é perdida durante a execução do programa via rede."
                   EXIT

              CASE EXCEPTION_ILLEGAL_INSTRUCTION
                   cMensagemErro := "EXCEPTION_ILLEGAL_INSTRUCTION - O thread tentou executar uma instrução inválida."
                   EXIT

              CASE EXCEPTION_NONCONTINUABLE_EXCEPTION
                   cMensagemErro := "EXCEPTION_NONCONTINUABLE_EXCEPTION - O thread tentou continuar a execução após a ocorrência de uma exceção irrecuperável."
                   EXIT

              CASE EXCEPTION_STACK_OVERFLOW
                   cMensagemErro := "EXCEPTION_STACK_OVERFLOW - O thread esgotou sua pilha (estouro de pilha)."
                   EXIT

              CASE EXCEPTION_INVALID_DISPOSITION
                   cMensagemErro := "EXCEPTION_INVALID_DISPOSITION - Um manipulador (handle) de exceções retornou uma disposição inválida para o tratador de exceções. Uma exceção deste tipo nunca deveria ser encontrada em linguagens de médio/alto nível."
                   EXIT

              CASE EXCEPTION_GUARD_PAGE
                   cMensagemErro := "CASE EXCEPTION_GUARD_PAGE"
                   EXIT

              CASE EXCEPTION_INVALID_HANDLE
                   cMensagemErro := "EXCEPTION_INVALID_HANDLE"
                   EXIT

              CASE EXCEPTION_SINGLE_STEP
                   cMensagemErro := "EXCEPTION_SINGLE_STEP Um interceptador de passos ou outro mecanismo de instrução isolada sinalizou que uma instrução foi executada."
                   EXIT

              CASE EXCEPTION_BREAKPOINT
                   cMensagemErro := "EXCEPTION_BREAKPOINT - Foi encontrado um ponto de parada (breakpoint)."
                   EXIT

              DEFAULT
                  cMensagemErro := "UNKNOWN EXCEPTION ( " + cStr( oException:ExceptionRecord:ExceptionCode ) + " )"

       END

    ENDIF

    && -- Verificando se houve erro GPF a nível das TDialogs
    oError := errorNew( "GPFHANDLER", 0, 0, procName(), "GPF - Erro Geral de Processo", { cMensagemErro, oException, nCodigoErro }, procFile(), procName(), procLine() )

        eval( errorBlock(), oError )  // errorDialog( oError )<<-- Changed here as you suggested Antonio

    RETURN( EXCEPTION_EXECUTE_HANDLER )

And calls on main with this:
setUnhandledExceptionFilter( @gpfHandler() )
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error Dialog?
Posted: Fri Jan 09, 2009 12:28 PM

Júlio,

Have you replaced your modified ErrSysW.prg inside FiveHX.lib or are you linking its OBJ as another OBJ of your application ?

It has to be linked before xHarbour own ErrorSys

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Re: Error Dialog?
Posted: Fri Jan 09, 2009 01:07 PM

>> Have you replaced your modified ErrSysW.prg inside FiveHX.lib or are you linking its OBJ as another OBJ of your application ?
>> It has to be linked before xHarbour own ErrorSys

Antonio, I following this steps:

1º I ran this batch command "tlib.exe H:\FWH\lib\fivehx.lib -errsysw.obj" to remove the .obj
2º I Made a original copy of errsysw.prg to my project diretory
3º I Made the changes like I have said to you above
4º I compile together with all files of my project.

PS.: In order to compile, my own errsysw.prg is compiled before all libs! Indeed, all are!

Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Re: Error Dialog?
Posted: Sat Jan 10, 2009 07:04 PM

Dear Antonio,

Thank you very much! I can resolve this problem!
Now, my dialog error default it's ok!

Thank you!!

Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Error Dialog? ( Solved! )
Posted: Sat Jan 10, 2009 11:40 PM

Julio,

For future reference, you don't need to remove the obj from the fw libs, just link your new obj before the libs.

Personally, I never modify the original FW libs, just so I don't have problems that are hard to find.

regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Re: Error Dialog? ( Solved! )
Posted: Sun Jan 11, 2009 01:33 AM

Now I know James!
This is much better! ;)

Thank you for your tip!

Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9

Continue the discussion