Catching GPF's

Catching GPF's

Postby AlexSchaft » Mon Jan 23, 2006 7:47 am

Hi.

I'm looking at catching GPF's in xHarbour using SetUnhandledExceptionfilter. Has anybody done this already that can provide me with a sample?

Thanks,
Alex
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby Antonio Linares » Mon Jan 23, 2006 8:37 am

Alex,

If you use the xHarbour build we provide from www.fivetechsoft.com/files/xharbour.exe it already include GPFs catching using SetUnhandledExceptionfilter().

Both Harbour and xHarbour already include support for SetUnhandledExceptionfilter() but you have to build them using this flag: -DHB_INCLUDE_WINEXCHANDLER

Also in xharbour this fix is needed in source\vm\mainwin.c:

Code: Select all  Expand view
int WINAPI WinMain( HINSTANCE hInstance,      /* handle to current instance */
                    HINSTANCE hPrevInstance,  /* handle to previous instance */
                    LPSTR lpCmdLine,          /* pointer to command line */
                    int iCmdShow )            /* show state of window */
{
   #ifdef HB_INCLUDE_WINEXCHANDLER
      LONG WINAPI hb_UnhandledExceptionFilter( struct _EXCEPTION_POINTERS * ExceptionInfo );
     
      LPTOP_LEVEL_EXCEPTION_FILTER ef = SetUnhandledExceptionFilter( hb_UnhandledExceptionFilter );
   #endif


And rename UnhandledExceptionFilter() as hb_UnhandledExceptionFilter() in source\vm\estack.c.

This code is already included in Harbour CVS files, but it is not in xharbour CVS.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41456
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

xHarbour gpf's

Postby AlexSchaft » Mon Jan 23, 2006 8:40 am

We're currently using the commercial version of xHarbour. I'll see what I can find out from their newsgroup.

Alex
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa


Return to FiveWin for Harbour/xHarbour

Who is online

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