Page 1 of 1
Catching GPF's
Posted: Mon Jan 23, 2006 7:47 am
by AlexSchaft
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
Posted: Mon Jan 23, 2006 8:37 am
by Antonio Linares
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
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.
xHarbour gpf's
Posted: Mon Jan 23, 2006 8:40 am
by AlexSchaft
We're currently using the commercial version of xHarbour. I'll see what I can find out from their newsgroup.
Alex