Changeset 1341 for trunk/fm4.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/fm4.c

    r1215 r1341  
    1010
    1111  05 Jan 08 SHL Sync
     12  14 Dec 08 SHL Add exception handler support
    1213
    1314***********************************************************************/
     
    1819#define INCL_WIN
    1920#define INCL_LONGLONG
     21#define INCL_DOSEXCEPTIONS              // XCTP_...
     22#define INCL_DOSERRORS                  // NO_ERROR
    2023
    2124#include "dll\fm3dll.h"
    22 #include "dll\mainwnd.h"                // Data declaration(s)
    23 #include "dll\notebook.h"               // Data declaration(s)
     25#include "dll\mainwnd.h"                // hwndBubble
     26#include "dll\notebook.h"               // appname
    2427#include "dll\tools.h"
    2528#include "dll\version.h"
    2629#include "dll\mainwnd2.h"               // StartFM32
    2730#include "dll\init.h"                   // InitFM3DLL
     31#include "dll\errutil.h"                // Error reporting
     32#include "dll\excputil.h"               // Exception handlers
     33
     34static PSZ pszSrcFile = __FILE__;
    2835
    2936int main(int argc, char *argv[])
     
    3340  QMSG qmsg;
    3441  HWND hwndFrame;
     42  APIRET regRet;
     43  UINT x;
     44  EXCEPTIONREGISTRATIONRECORD regRec = { NULL, NULL };
    3545
    3646  strcpy(appname, "FM/4");
    37   {
    38     INT x;
     47  DosError(FERR_DISABLEHARDERR);
    3948
    40     for (x = 1; x < argc; x++) {
    41       if (*argv[x] == '+' && !argv[x][1])
    42         fLogFile = TRUE;
    43       if (*argv[x] == '-') {
    44         if (argv[x][1])
    45           strcpy(profile, &argv[x][1]);
    46       }
     49  regRec.ExceptionHandler = HandleException;
     50  regRet = DosSetExceptionHandler(&regRec);
     51  if (regRet != NO_ERROR) {
     52    DbgMsg(pszSrcFile, __LINE__,
     53           "DosSetExceptionHandler failed with error %u", regRet);
     54  }
     55
     56  for (x = 1; x < argc; x++) {
     57    if (*argv[x] == '+' && !argv[x][1])
     58      fLogFile = TRUE;
     59    if (*argv[x] == '-') {
     60      if (argv[x][1])
     61        strcpy(profile, &argv[x][1]);
    4762    }
    4863  }
    49   DosError(FERR_DISABLEHARDERR);
     64
    5065  hab = WinInitialize(0);
    5166  if (hab) {
Note: See TracChangeset for help on using the changeset viewer.