Changeset 335 for trunk/dll/seticon.c


Ignore:
Timestamp:
Jul 25, 2006, 9:03:44 PM (19 years ago)
Author:
root
Message:

Use Runtime_Error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/seticon.c

    r2 r335  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  Edit ICON EA
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2006 Steven H.Levine
     10
     11  17 Jul 06 SHL Use Runtime_Error
     12
     13***********************************************************************/
     14
    115#define INCL_DOS
    216#define INCL_WIN
     17#include <os2.h>
    318
    4 #include <os2.h>
    519#include <stdio.h>
    620#include <stdlib.h>
     
    822#include <ctype.h>
    923#include <share.h>
     24
    1025#include "fm3dll.h"
    1126#include "fm3dlg.h"
    1227
    1328#pragma data_seg(DATA2)
     29
     30static PSZ pszSrcFile = __FILE__;
     31
    1432#pragma alloc_text(MENU,SetIconDlgProc)
    1533
    1634
    17 
    18 MRESULT EXPENTRY SetIconDlgProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
    19 
     35MRESULT EXPENTRY SetIconDlgProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
     36{
    2037  switch(msg) {
    2138    case WM_INITDLG:
     
    4360            icf.cb = sizeof(ICONINFO);
    4461            icf.fFormat = ICON_DATA;
    45             if(filename && *filename) {
    46               fp = _fsopen(filename,"rb",SH_DENYNO);
    47               if(fp) {
     62            if (filename && *filename) {
     63              fp = xfsopen(filename,"rb",SH_DENYNO,pszSrcFile,__LINE__);
     64              if(!fp)
     65                break;
     66              else {
    4867                fseek(fp,0L,SEEK_END);
    4968                icf.cbIconData = ftell(fp);
    5069                fseek(fp,0L,SEEK_SET);
    51                 buff = malloc(icf.cbIconData);
    52                 if(!buff) {
     70                buff = xmalloc(icf.cbIconData,pszSrcFile,__LINE__);
     71                if (!buff) {
    5372                  fclose(fp);
    54                   DosBeep(50,100);
    5573                  break;
    5674                }
     
    5876                icf.pIconData = (PVOID)buff;
    5977                fclose(fp);
    60               }
    61               else {
    62                 DosBeep(50,100);
    63                 break;
    6478              }
    6579            }
     
    7993                                     (PICONINFO)((filename && *filename) ?
    8094                                      &icf : NULL)))
    81               DosBeep(250,100);
     95            {
     96              Win_Error(hwnd,hwnd,pszSrcFile,__LINE__,"WinSetSysPointerData");
     97            }
    8298            if(buff)
    8399              free(buff);
Note: See TracChangeset for help on using the changeset viewer.