Changeset 1698 for trunk/dll/errutil.c
- Timestamp:
- Nov 7, 2013, 6:18:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/errutil.c
r1686 r1698 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2004, 201 0Steven H. Levine9 Copyright (c) 2004, 2013 Steven H. Levine 10 10 11 11 12 Aug 04 SHL Comments … … 37 37 01 Dec 10 SHL Dos_Error - remap API errors code that with odd oso001*.msg messages 38 38 10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options 39 Added saymsg2 for this purpose 39 Added saymsg2 for this purpose 40 07 Nov 13 SHL Update comments 40 41 41 42 ***********************************************************************/ … … 57 58 #include "notebook.h" // fErrorBeepOff 58 59 #include "init.h" // Data declares 59 #include "wrappers.h" 60 #include "wrappers.h" // xmallocz 60 61 61 62 #pragma data_seg(DATA1) … … 69 70 static APIRET showMsg(ULONG mb_type, HWND hwnd, PCSZ pszTitle, PCSZ pszMsg, BOOL wantLog); 70 71 71 //=== DbgMsg: output debug message stderr === 72 /** 73 * Format debug message and output to stderr 74 * @note: Local errors also written to stderr 75 */ 72 76 73 77 VOID DbgMsg(PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...) … … 118 122 } // DbgMsg 119 123 120 //== Dos_Error: report Dos...() error using passed message string === 124 /** 125 * Format Dos...() error and output using showMsg 126 * @note: Local errors written directly to stderr 127 */ 121 128 122 129 // 2010-12-01 SHL fixme for ULONG to be APIRET … … 298 305 } 299 306 300 //== Runtime_Error: report runtime library error using passed message string === 301 //If pszFmt is NULL a No Data error message is returned GKY 20 Feb 09 (Replaces Runtime_Error2) 307 /** 308 * Format runtime error message and output using showMsg 309 * @note: Local errors written directly to stderr 310 * @note: If pszFmt is NULL a No Data error message is returned GKY 20 Feb 09 (Replaces Runtime_Error2) 311 */ 302 312 303 313 VOID Runtime_Error(PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...) … … 331 341 } // Runtime_Error 332 342 333 //=== saymsg: report misc error using passed message === 343 /** 344 * Format message and output using showMsg 345 * @note: Local errors written directly to stderr 346 */ 334 347 335 348 APIRET saymsg(ULONG mb_type, HWND hwnd, PCSZ pszTitle, PCSZ pszFmt, ...) … … 352 365 } // saymsg 353 366 367 /** 368 * Format message with custom buttons and output using showMsg 369 * Local errors written to stderr 370 */ 371 354 372 APIRET saymsg2(PCSZ pszButtonNames, int DefaultButton, HWND hwnd, PCSZ pszTitle, PCSZ pszFmt, ...) 355 373 { 356 ULONG 357 APIRET 358 CHAR szMsg[4096]; 359 va_list va; 360 MB2INFO *pmbInfo; 361 MB2D mb2dBut[4]; 362 ULONG 374 ULONG i; 375 APIRET rc; 376 CHAR szMsg[4096]; 377 va_list va; 378 MB2INFO *pmbInfo; 379 MB2D mb2dBut[4]; 380 ULONG ulInfoSize = (sizeof(MB2INFO) + (sizeof(MB2D) * 3)); 363 381 364 382 va_start(va, pszFmt); … … 386 404 pmbInfo = xmallocz(ulInfoSize, pszSrcFile, __LINE__); 387 405 if (pmbInfo) { 388 pmbInfo->cb = ulInfoSize;406 pmbInfo->cb = ulInfoSize; 389 407 pmbInfo->hIcon = 0; 390 408 pmbInfo->cButtons = 4; … … 393 411 for (i = 0; i < 4; i++) { 394 412 memcpy( pmbInfo->mb2d+i , mb2dBut+i , sizeof(MB2D)); 395 } 413 } 396 414 rc = WinMessageBox2(HWND_DESKTOP, hwnd, 397 398 415 szMsg, pszTitle, 1234, 416 pmbInfo); 399 417 free(pmbInfo); 400 418 return rc; … … 403 421 } 404 422 405 //=== showMsg: display error popup === 423 /** 424 * Display message in popup message box 425 * Optionally writes formatted message to stderr 426 */ 406 427 407 428 static APIRET showMsg(ULONG mb_type, HWND hwndOwner, … … 426 447 } // showMsg 427 448 428 //== Win_Error: report Win...() error using passed message string === 449 /** 450 * Format Win...() error and output using showMsg 451 */ 429 452 430 453 VOID Win_Error(HWND hwndErr, HWND hwndOwner, … … 446 469 447 470 /** 448 * Output PM error messsageto stderr449 * This does t osame reporting as Win_Error, but bypasses the471 * Format PM error messsage and output to stderr 472 * This does the same reporting as Win_Error, but bypasses the 450 473 * message box popup. 451 474 * Use this version when the popup would hang PM.
Note:
See TracChangeset
for help on using the changeset viewer.