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.