[273] | 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
|
---|
[1082] | 9 | Copyright (c) 2005, 2008 Steven H. Levine
|
---|
[273] | 10 |
|
---|
| 11 | 15 Oct 02 SHL Baseline
|
---|
| 12 | 07 Dec 05 SHL Avoid warnings
|
---|
[1341] | 13 | 14 Dec 08 SHL Add exception handler support
|
---|
| 14 | 14 Dec 08 SHL Drop NEVER used code
|
---|
[273] | 15 |
|
---|
| 16 | ***********************************************************************/
|
---|
| 17 |
|
---|
[907] | 18 | #include <string.h>
|
---|
| 19 |
|
---|
[2] | 20 | #define INCL_WIN
|
---|
[907] | 21 | #define INCL_LONGLONG
|
---|
[1341] | 22 | #define INCL_DOSEXCEPTIONS // XCTP_...
|
---|
| 23 | #define INCL_DOSERRORS // NO_ERROR
|
---|
[2] | 24 |
|
---|
[1176] | 25 | #include "dll\fm3dll.h"
|
---|
[1341] | 26 | #include "dll\notebook.h" // appname
|
---|
[273] | 27 | #include "dll\datamin.h"
|
---|
[2] | 28 | #include "dll\fm3dlg.h"
|
---|
[1176] | 29 | #include "dll\init.h" // InitFM3DLL
|
---|
[1341] | 30 | #include "dll\errutil.h" // Error reporting
|
---|
| 31 | #include "dll\excputil.h" // Exception handlers
|
---|
[2] | 32 |
|
---|
[1341] | 33 | static PSZ pszSrcFile = __FILE__;
|
---|
[2] | 34 |
|
---|
[551] | 35 | int main(int argc, char *argv[])
|
---|
| 36 | {
|
---|
| 37 | HAB hab;
|
---|
| 38 | HMQ hmq;
|
---|
| 39 | QMSG qmsg;
|
---|
[1341] | 40 | APIRET regRet;
|
---|
| 41 | EXCEPTIONREGISTRATIONRECORD regRec = { NULL, NULL };
|
---|
[2] | 42 |
|
---|
[551] | 43 | strcpy(appname, "DATABAR");
|
---|
[273] | 44 |
|
---|
[1341] | 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 | }
|
---|
[273] | 51 |
|
---|
[2] | 52 | hab = WinInitialize(0);
|
---|
[551] | 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 | }
|
---|
[2] | 61 | }
|
---|
| 62 | WinDestroyMsgQueue(hmq);
|
---|
| 63 | }
|
---|
| 64 | WinTerminate(hab);
|
---|
| 65 | }
|
---|
| 66 | return 0;
|
---|
| 67 | }
|
---|