Changeset 352 for trunk/dll/mainwnd2.c


Ignore:
Timestamp:
Jul 26, 2006, 9:35:45 PM (19 years ago)
Author:
root
Message:

Use Runtime_Error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/mainwnd2.c

    r299 r352  
    1414  02 Jan 06 SHL Use QWL_USER more
    1515  02 Jan 06 SHL Map IDM_WINDOWDLG to match IBM_TWODIRS
     16  17 Jul 06 SHL Use Runtime_Error
    1617
    1718***********************************************************************/
     
    2021#define INCL_WIN
    2122#define INCL_GPI
    22 
    2323#include <os2.h>
     24
    2425#include <stdlib.h>
    2526#include <stdio.h>
     
    4445  HWND hwndMax;
    4546} PERSON1DATA;
     47
     48static PSZ pszSrcFile = __FILE__;
    4649
    4750#pragma alloc_text(PERSON11,MainFrameWndProc2,MainWndProc2)
     
    515518          COMPARE *cmp;
    516519
    517           cmp = malloc(sizeof(COMPARE));
    518           if (cmp)
    519           {
    520             memset(cmp, 0, sizeof(COMPARE));
     520          cmp = xmallocz(sizeof(COMPARE),pszSrcFile,__LINE__);
     521          if (cmp) {
    521522            cmp -> size = sizeof(COMPARE);
    522523            strcpy(cmp -> leftdir, wa.szCurrentPath1);
     
    731732      if (!hwndCnr)
    732733      {
    733         DosBeep(50, 100);
     734        Runtime_Error(pszSrcFile, __LINE__, "no window");
    734735        break;
    735736      }
     
    817818    WinSetWindowUShort(hwnd, QWL_USER + 12, 0);
    818819    WinSetWindowUShort(hwnd, QWL_USER + 16, 0);
    819     if (_beginthread(MakeMainObjWin,
    820                      NULL,
    821                      245760,
    822                      MPVOID) == -1)
    823     {
    824       PostMsg(hwnd,
    825               WM_CLOSE,
    826               MPVOID,
    827               MPVOID);
     820    if (_beginthread(MakeMainObjWin,NULL,245760,MPVOID) == -1) {
     821      Runtime_Error(pszSrcFile, __LINE__, GetPString(IDS_COULDNTSTARTTHREADTEXT));
     822      PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
    828823      return 0;
    829824    }
     
    831826      DosSleep(64);
    832827
    833     pd = malloc(sizeof(PERSON1DATA));
     828    pd = xmallocz(sizeof(PERSON1DATA),pszSrcFile,__LINE__);
    834829    if (!pd)
    835830      WinDestroyWindow(WinQueryWindow(hwnd, QW_PARENT));
    836     else
    837     {
    838       memset(pd, 0, sizeof(PERSON1DATA));
     831    else {
    839832      pd -> size = sizeof(PERSON1DATA);
    840833      WinSetWindowPtr(hwnd, QWL_USER + 4, (PVOID)pd);
Note: See TracChangeset for help on using the changeset viewer.