source: trunk/viewinfs.c@ 1341

Last change on this file since 1341 was 1341, checked in by Steven Levine, 17 years ago

Ticket 26: add thread 1 exception handler support to applets

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
RevLine 
[2]1
[753]2/***********************************************************************
3
4 $Id: viewinfs.c 1341 2008-12-14 22:18:26Z stevenhl $
5
6 INF viewer applet
7
8 Copyright (c) 1993-98 M. Kimes
[1341]9 Copyright (c) 2007, 2008 Steven H.Levine
[753]10
11 03 Aug 07 SHL Minor cleanup
[1341]12 14 Dec 08 SHL Add exception handler support
[753]13
14***********************************************************************/
15
[1341]16#define INCL_DOS // DosSleep
[753]17#define INCL_WIN
[1341]18#define INCL_DOSEXCEPTIONS // XCTP_...
19#define INCL_DOSERRORS // NO_ERROR
[753]20
[1177]21#include "dll\fm3dll.h"
[1341]22#include "dll\notebook.h" // appname
23#include "dll\mainwnd.h" // FM3ModHandle
[907]24#include "dll\fm3dlg.h"
[1341]25#include "dll\init.h" // InitFM3DLL
26#include "dll\viewinf.h" // ViewInfProc
27#include "dll\errutil.h" // Error reporting
28#include "dll\excputil.h" // Exception handlers
[2]29
[1341]30static PSZ pszSrcFile = __FILE__;
31
[551]32int main(int argc, char *argv[])
33{
34 HAB hab;
35 HMQ hmq;
[1341]36 APIRET regRet;
37 EXCEPTIONREGISTRATIONRECORD regRec = { NULL, NULL };
[2]38
[1341]39 regRec.ExceptionHandler = HandleException;
40 regRet = DosSetExceptionHandler(&regRec);
41 if (regRet != NO_ERROR) {
42 DbgMsg(pszSrcFile, __LINE__,
43 "DosSetExceptionHandler failed with error %u", regRet);
44 }
45
[2]46 hab = WinInitialize(0);
[551]47 if (hab) {
48 hmq = WinCreateMsgQueue(hab, 256);
49 if (hmq) {
50 if (InitFM3DLL(hab, argc, argv)) {
[1341]51 WinDlgBox(HWND_DESKTOP,
52 HWND_DESKTOP,
53 ViewInfProc,
54 FM3ModHandle,
55 VINF_FRAME, ((argc > 1) ? MPFROMP("") : MPVOID));
[2]56 }
[753]57 DosSleep(250);
[2]58 WinDestroyMsgQueue(hmq);
59 }
60 WinTerminate(hab);
61 }
62 return 0;
63}
Note: See TracBrowser for help on using the repository browser.