Changeset 1341 for trunk/eas.c


Ignore:
Timestamp:
Dec 14, 2008, 11:18:26 PM (17 years ago)
Author:
Steven Levine
Message:

Ticket 26: add thread 1 exception handler support to applets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eas.c

    r1215 r1341  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2002, 2007 Steven H.Levine
     9  Copyright (c) 2002, 2008 Steven H.Levine
    1010
    1111  16 Oct 02 SHL Reformat
     
    1414  08 Apr 07 SHL Minor reformat
    1515  10 May 08 SHL Correct compare typo
     16  14 Dec 08 SHL Add exception handler support
    1617
    1718***********************************************************************/
    1819
    19 #include <stdlib.h>
    2020#include <string.h>
    2121
    2222#define INCL_DOS
    2323#define INCL_WIN
     24#define INCL_DOSEXCEPTIONS              // XCTP_...
     25#define INCL_DOSERRORS                  // NO_ERROR
    2426
    2527#include "dll\fm3dll.h"
    26 #include "dll\notebook.h"                       // Data declaration(s)
    27 #include "dll\mainwnd.h"                        // Data declaration(s)
     28#include "dll\mainwnd.h"                // FM3ModHandle
    2829#include "dll\fm3dlg.h"
    29 #include "dll\makelist.h"
     30#include "dll\makelist.h"               // AddToList
    3031#include "dll\eas.h"                    // DisplayEAsProc
    3132#include "dll\init.h"                   // InitFM3DLL
    3233#include "dll\valid.h"                  // IsFile
    33 #include "dll\wrappers.h"                       // xfree
    34 #include "dll\getnames.h"                       // insert_filename
     34#include "dll\wrappers.h"               // xfree
     35#include "dll\getnames.h"               // insert_filename
     36#include "dll\errutil.h"                // Error reporting
     37#include "dll\excputil.h"               // Exception handlers
    3538
    3639static PSZ pszSrcFile = __FILE__;
     
    4245  CHAR fullname[CCHMAXPATH];
    4346  CHAR **list = NULL;
    44   UINT x,numfiles = 0,numalloc = 0;
     47  UINT x;
     48  UINT numfiles = 0;
     49  UINT numalloc = 0;
     50  APIRET regRet;
     51  EXCEPTIONREGISTRATIONRECORD regRec = { NULL, NULL };
    4552
    4653  DosError(FERR_DISABLEHARDERR);
     54
     55  regRec.ExceptionHandler = HandleException;
     56  regRet = DosSetExceptionHandler(&regRec);
     57  if (regRet != NO_ERROR) {
     58    DbgMsg(pszSrcFile, __LINE__,
     59           "DosSetExceptionHandler failed with error %u", regRet);
     60  }
     61
    4762  for(x = 1; x < argc; x++) {
    4863    if (!strchr("/;,`\'",*argv[x]) && IsFile(argv[x]) != -1) {
     
    5469    }
    5570  }
     71
    5672  hab = WinInitialize(0);
    5773  if (hab) {
Note: See TracChangeset for help on using the changeset viewer.