Clipper On Line • Ver Tópico - Controle de GPFs

Controle de GPFs

Discussão sobre a biblioteca Fivewin - O Clipper para Windows.

Moderador: Moderadores

 

Controle de GPFs

Mensagempor Kapiaba » 14 Mai 2015 10:40

Alguém pode testar esta função, com meu FWH não está funcionando, quebra o programa aqui: + Str( aTimerInfo[ 1 ] )

// Testing Windows ToolHelp.dll

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

   local aTimerInfo := TimerCount()

   // Determining how long an application has been running

   MsgInfo( "Milliseconds since this task started: " + Str( aTimerInfo[ 1 ] ) )
   MsgInfo( "Milliseconds since the VM started:    " + Str( aTimerInfo[ 2 ] ) )

   // Controlling possible GPFs !!!

   InterruptRegister( { || ControlGPF() } )  // Setting our own GPF controller
   // Comment the above function and see the difference !

   __GenGPF()                                // Now we generate a GPF !!!

return nil

//----------------------------------------------------------------------------//

function ControlGPF()

   MsgAlert( "A GPF has occurred" + CRLF + "I am URGENTLY closing everything!" )

   // CLOSE ALL           --> Here we close all our files !!!

   MsgInfo( "We recommend reboot the computer, or at least exit Windows" )

   InterruptUnRegister()   // We release our GPF controller

   Eval( ErrorBlock(), _FWGenError( 5, "Undetermined GPF" ) )
                                   // you can use the FiveWin
                                   // Error SubSystem !!!

return nil

/*
Application
===========
   Path and name: C:\FWH1306\samples\TESTE.exe (32 bits)
   Size: 2,408,960 bytes
   Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20150419)
   FiveWin  Version: FWHX 13.05
   Windows version: 6.1, Build 7601 Service Pack 1

   Time from start: 0 hours 0 mins 0 secs
   Error occurred at: 05/14/15, 10:32:35
   Error description: Error BASE/1068  Argument error: array access
   Args:
     [   1] = U   
     [   2] = N   2

Stack Calls
===========
   Called from: TESTE.prg => MAIN( 14 )
*/


Obg. abs.
Kapiaba
Colaborador

Colaborador
 
Mensagens: 1766
Data de registro: 07 Dez 2012 15:14
Cidade/Estado: São Paulo
Curtiu: 311 vezes
Mens.Curtidas: 119 vezes



Retornar para FiveWin

Quem está online

Usuários vendo este fórum: Nenhum usuário registrado online e 3 visitantes


Ola Amigo, espero que meu site e forum tem lhe beneficiado, com exemplos e dicas de programacao.
Entao divulgue o link da Doacao abaixo para seus amigos e redes sociais ou faça uma doacao para o site forum...
MUITO OBRIGADO PELA SUA DOACAO!
Faça uma doação para o forum
cron
v
Olá visitante, seja bem-vindo ao Fórum Clipper On Line!
Efetue o seu login ou faça o seu Registro