| 1 | 
 | 
|---|
| 2 | /***********************************************************************
 | 
|---|
| 3 | 
 | 
|---|
| 4 |   $Id: databar.c 1341 2008-12-14 22:18:26Z stevenhl $
 | 
|---|
| 5 | 
 | 
|---|
| 6 |   databar applet
 | 
|---|
| 7 | 
 | 
|---|
| 8 |   Copyright (c) 1993-98 M. Kimes
 | 
|---|
| 9 |   Copyright (c) 2005, 2008 Steven H. Levine
 | 
|---|
| 10 | 
 | 
|---|
| 11 |   15 Oct 02 SHL Baseline
 | 
|---|
| 12 |   07 Dec 05 SHL Avoid warnings
 | 
|---|
| 13 |   14 Dec 08 SHL Add exception handler support
 | 
|---|
| 14 |   14 Dec 08 SHL Drop NEVER used code
 | 
|---|
| 15 | 
 | 
|---|
| 16 | ***********************************************************************/
 | 
|---|
| 17 | 
 | 
|---|
| 18 | #include <string.h>
 | 
|---|
| 19 | 
 | 
|---|
| 20 | #define INCL_WIN
 | 
|---|
| 21 | #define INCL_LONGLONG
 | 
|---|
| 22 | #define INCL_DOSEXCEPTIONS              // XCTP_...
 | 
|---|
| 23 | #define INCL_DOSERRORS                  // NO_ERROR
 | 
|---|
| 24 | 
 | 
|---|
| 25 | #include "dll\fm3dll.h"
 | 
|---|
| 26 | #include "dll\notebook.h"               // appname
 | 
|---|
| 27 | #include "dll\datamin.h"
 | 
|---|
| 28 | #include "dll\fm3dlg.h"
 | 
|---|
| 29 | #include "dll\init.h"                   // InitFM3DLL
 | 
|---|
| 30 | #include "dll\errutil.h"                // Error reporting
 | 
|---|
| 31 | #include "dll\excputil.h"               // Exception handlers
 | 
|---|
| 32 | 
 | 
|---|
| 33 | static PSZ pszSrcFile = __FILE__;
 | 
|---|
| 34 | 
 | 
|---|
| 35 | int main(int argc, char *argv[])
 | 
|---|
| 36 | {
 | 
|---|
| 37 |   HAB hab;
 | 
|---|
| 38 |   HMQ hmq;
 | 
|---|
| 39 |   QMSG qmsg;
 | 
|---|
| 40 |   APIRET regRet;
 | 
|---|
| 41 |   EXCEPTIONREGISTRATIONRECORD regRec = { NULL, NULL };
 | 
|---|
| 42 | 
 | 
|---|
| 43 |   strcpy(appname, "DATABAR");
 | 
|---|
| 44 | 
 | 
|---|
| 45 |   regRec.ExceptionHandler = HandleException;
 | 
|---|
| 46 |   regRet = DosSetExceptionHandler(®Rec);
 | 
|---|
| 47 |   if (regRet != NO_ERROR) {
 | 
|---|
| 48 |     DbgMsg(pszSrcFile, __LINE__,
 | 
|---|
| 49 |            "DosSetExceptionHandler failed with error %u", regRet);
 | 
|---|
| 50 |   }
 | 
|---|
| 51 | 
 | 
|---|
| 52 |   hab = WinInitialize(0);
 | 
|---|
| 53 |   if (hab) {
 | 
|---|
| 54 |     hmq = WinCreateMsgQueue(hab, 384);
 | 
|---|
| 55 |     if (hmq) {
 | 
|---|
| 56 |       if (InitFM3DLL(hab, argc, argv)) {
 | 
|---|
| 57 |         if (CreateDataBar(HWND_DESKTOP, 0)) {
 | 
|---|
| 58 |           while (WinGetMsg(hab, &qmsg, (HWND) 0, 0, 0))
 | 
|---|
| 59 |             WinDispatchMsg(hab, &qmsg);
 | 
|---|
| 60 |         }
 | 
|---|
| 61 |       }
 | 
|---|
| 62 |       WinDestroyMsgQueue(hmq);
 | 
|---|
| 63 |     }
 | 
|---|
| 64 |     WinTerminate(hab);
 | 
|---|
| 65 |   }
 | 
|---|
| 66 |   return 0;
 | 
|---|
| 67 | }
 | 
|---|