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

    r1216 r1341  
    1010
    1111  05 Jan 08 SHL Sync
     12  14 Dec 08 SHL Add exception handler support
    1213
    1314***********************************************************************/
    1415
    15 #define INCL_DOS
    1616#define INCL_WIN
     17#define INCL_DOSEXCEPTIONS              // XCTP_...
     18#define INCL_DOSERRORS                  // NO_ERROR
    1719
    1820#include "dll\fm3dll.h"
    19 #include "dll\mainwnd.h"                        // Data declaration(s)
     21#include "dll\mainwnd.h"                // FM3ModHandle
    2022#include "dll\fm3dlg.h"
    21 #include "dll\init.h"                           // InitFM3DLL
    22 #include "dll\sysinfo.h"                        // SysInfoDlgProc
     23#include "dll\init.h"                   // InitFM3DLL
     24#include "dll\sysinfo.h"                // SysInfoDlgProc
     25#include "dll\errutil.h"                // Error reporting
     26#include "dll\excputil.h"               // Exception handlers
     27
     28static PSZ pszSrcFile = __FILE__;
    2329
    2430int main(int argc, char *argv[])
     
    2632  HAB hab;
    2733  HMQ hmq;
     34  APIRET regRet;
     35  EXCEPTIONREGISTRATIONRECORD regRec = { NULL, NULL };
     36
     37  regRec.ExceptionHandler = HandleException;
     38  regRet = DosSetExceptionHandler(&regRec);
     39  if (regRet != NO_ERROR) {
     40    DbgMsg(pszSrcFile, __LINE__,
     41           "DosSetExceptionHandler failed with error %u", regRet);
     42  }
    2843
    2944  hab = WinInitialize(0);
     
    3247    if (hmq) {
    3348      if (InitFM3DLL(hab, argc, argv)) {
    34         WinDlgBox(HWND_DESKTOP, HWND_DESKTOP,
    35                   SysInfoDlgProc, FM3ModHandle, SYS_FRAME, NULL);
     49        WinDlgBox(HWND_DESKTOP, HWND_DESKTOP,
     50                  SysInfoDlgProc, FM3ModHandle, SYS_FRAME, NULL);
    3651      }
    3752      WinDestroyMsgQueue(hmq);
Note: See TracChangeset for help on using the changeset viewer.