Changeset 1395 for trunk/dll/errutil.c


Ignore:
Timestamp:
Feb 8, 2009, 2:48:16 AM (17 years ago)
Author:
Gregg Young
Message:

Allow user to turn off alert and/or error beeps in settings notebook. Ticket 341 Move repeated strings to PCSZs. Ticket 6 Add *DateFormat functions to format dates based on locale Ticket 28 Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error Ticket 6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/errutil.c

    r1373 r1395  
    2929  05 Jan 08 SHL Renamed from error.c to match errutil.h
    3030  18 Dec 08 SHL Show thread id in DbgMsg
     31  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
     32  07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
     33  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    3134
    3235***********************************************************************/
     
    4043#define INCL_DOSERRORS
    4144#define INCL_DOSPROCESS                 // PPIB PTIB
     45#define INCL_LONGLONG
    4246
    4347#include "errutil.h"
    4448#include "strutil.h"                    // GetPString
    4549#include "fm3str.h"
     50#include "notebook.h"                   // fErrorBeepOff
    4651
    4752#pragma data_seg(GLOBAL2)
     
    135140  }
    136141
    137   if (strchr(szMsg, ' ') == NULL)
    138     strcat(szMsg, " failed");           // Assume simple function name
     142  if (strchr(szMsg, ' ') == NULL) {
     143    strcat(szMsg, " ");
     144    strcat(szMsg, GetPString(IDS_FAILEDTEXT));          // Assume simple function name
     145  }
    139146
    140147  DosErrClass(ulRC, &Class, &action, &Locus);
     
    185192} // Dos_Error
    186193
    187 //== Dos_Error2: report Dos...() error using passed message id ===
     194/*== Dos_Error2: report Dos...() error using passed message id ===
    188195
    189196INT Dos_Error2(ULONG mb_type, ULONG ulRC, HWND hwndOwner,
     
    192199  return Dos_Error(mb_type, ulRC, hwndOwner, pszSrcFile, uSrcLineNo,
    193200                   GetPString(idMsg));
    194 } // Dos_Error2
     201} // Dos_Error2 */
    195202
    196203/**
     
    224231  }
    225232
    226   if (strchr(pszBuf, ' ') == NULL)
    227     strcat(pszBuf, " failed");          // Assume simple function name
     233  if (strchr(pszBuf, ' ') == NULL) {
     234    strcat(pszBuf, " ");
     235    strcat(pszBuf, GetPString(IDS_FAILEDTEXT));         // Assume simple function name
     236  }
    228237
    229238  // Append file name and line number and trailing space
     
    303312  }
    304313
    305   if (strchr(szMsg, ' ') == NULL)
    306     strcat(szMsg, " failed");           // Assume simple function name
     314  if (strchr(szMsg, ' ') == NULL) {
     315    strcat(szMsg, " ");
     316    strcat(szMsg, GetPString(IDS_FAILEDTEXT));          // Assume simple function name
     317  }
    307318
    308319  sprintf(szMsg + strlen(szMsg),
    309320          GetPString(IDS_GENERR1TEXT), pszSrcFile, uSrcLineNo);
    310321
    311   showMsg(MB_ICONEXCLAMATION, HWND_DESKTOP, DEBUG_STRING, szMsg, TRUE);
     322  showMsg(MB_ICONEXCLAMATION, HWND_DESKTOP, GetPString(IDS_DEBUG_STRING), szMsg, TRUE);
    312323
    313324} // Runtime_Error
     
    358369  if (!hwndOwner)
    359370    hwndOwner = HWND_DESKTOP;
    360 
    361   DosBeep(250, 100);
     371  if (!fErrorBeepOff)
     372    DosBeep(250, 100);
    362373
    363374  return WinMessageBox(HWND_DESKTOP,    // Parent
     
    386397} // Win_Error
    387398
    388 //== Win_Error2: report Win...() error using passed message id ===
     399/*== Win_Error2: report Win...() error using passed message id ===
    389400
    390401VOID Win_Error2(HWND hwndErr, HWND hwndOwner,
     
    393404  Win_Error(hwndErr, hwndOwner, pszSrcFile, uSrcLineNo, GetPString(idMsg));
    394405
    395 } // Win_Error2
     406} // Win_Error2 */
    396407
    397408/**
     
    417428  fputc('\n', stderr);
    418429  fflush(stderr);
    419 
    420   DosBeep(250, 100);
     430  if (!fErrorBeepOff)
     431    DosBeep(250, 100);
    421432
    422433} // Win_Error_NoMsgBox
Note: See TracChangeset for help on using the changeset viewer.