Changeset 616 for trunk/dll/error.c


Ignore:
Timestamp:
Apr 20, 2007, 8:53:00 PM (18 years ago)
Author:
Steven Levine
Message:

Add DbgMsg
Correct IDS_GENERR1TEXT formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/error.c

    r614 r616  
    2222  07 Jan 07 GKY Move error strings etc. to string file
    2323  18 Apr 07 SHL showMsg: correct selective logging checks
     24  19 Apr 07 SHL Add DbgMsg
     25  20 Apr 07 SHL Correct IDS_GENERR1TEXT formatting
    2426
    2527***********************************************************************/
     
    5860
    5961  if (hwndErr == NULLHANDLE)
    60     hab = (HAB) 0;
     62    hab = (HAB)0;
    6163  else
    6264    hab = WinQueryAnchorBlock(hwndErr);
     
    7880  // Append file name and line number
    7981  sprintf(szMsg + strlen(szMsg),
    80           GetPString(IDS_GENERR1TEXT), pszFileName, ulLineNo, " ");
     82          GetPString(IDS_GENERR1TEXT), pszFileName, ulLineNo);
    8183
    8284  // Get last PM error for the current thread
     
    274276//=== showMsg: display error popup ===
    275277
    276 static APIRET showMsg(ULONG mb_type, HWND hwnd, PCSZ pszTitle, PCSZ pszMsg, BOOL wantLog)
     278static APIRET showMsg(ULONG mb_type, HWND hwndOwner, PCSZ pszTitle, PCSZ pszMsg, BOOL wantLog)
    277279{
    278280  if (wantLog) {
     
    283285  }
    284286
    285   if (!hwnd)
    286     hwnd = HWND_DESKTOP;
     287  if (!hwndOwner)
     288    hwndOwner = HWND_DESKTOP;
    287289
    288290  DosBeep(250, 100);
    289291
    290292  return WinMessageBox(HWND_DESKTOP,    // Parent
    291                        hwnd,            // Owner
     293                       hwndOwner,
    292294                       (PSZ) pszMsg, (PSZ) pszTitle, 0, // help id
    293295                       mb_type | MB_MOVEABLE);
    294296} // showMsg
     297
     298//=== DbgMsg: output debug message stderr ===
     299
     300VOID DbgMsg(PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...)
     301{
     302  va_list va;
     303
     304  // OK for source file name to be null
     305  fprintf(stderr, "%s %u", pszSrcFile ? pszSrcFile : "n/a", uSrcLineNo);
     306  // If format null want just file and line
     307  if (pszFmt) {
     308    fputc(' ', stderr);
     309    va_start(va, pszFmt);
     310    vfprintf(stderr, pszFmt, va);
     311    va_end(va);
     312  }
     313  fputc('\n', stderr);
     314  fflush(stderr);
     315
     316} // DbgMsg
     317
Note: See TracChangeset for help on using the changeset viewer.