Changeset 1449 for trunk/dll/errutil.c


Ignore:
Timestamp:
Jul 26, 2009, 10:00:52 PM (16 years ago)
Author:
Gregg Young
Message:

Fix failure of containers to update when Tree container isn't open in FM2 lite; get DosGetMessage to work in HIMEM builds (Ticket 389, 390)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/errutil.c

    r1447 r1449  
    3333  07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
    3434  08 Mar 09 GKY Remove Dos_Error2 (unused) and Runtime_Error2 (no advantage over using Runtime_Error)
    35   23 Jul 09 GKY Bypass DosGetMessage for HIMEM builds (it traps)
     35  23 Jul 09 GKY Add low mem buffers for the msg file name so DosGetMessage
     36                works in HIMEM builds
    3637
    3738***********************************************************************/
     
    118119{
    119120  CHAR szMsg[4096];
     121  CHAR *szMsgFile, *szMsgFileH;
    120122  ULONG Class;                          // Error class
    121123  ULONG action;                         // Error action
    122   ULONG Locus;                          // Error location
    123 #ifndef HIMEM
     124  ULONG Locus;                          // Error location
    124125  ULONG ulMsgLen;
    125126  CHAR *pszMsgStart;
    126127  CHAR *psz;
    127 #endif
    128128  va_list va;
    129129
     
    131131    return MBID_ENTER;                  // Should not have been called
    132132
     133  //Allocate low memory for DosGetMessage (16 bit)
     134  DosAllocMem((PVOID) &szMsgFile, CCHMAXPATH,
     135               PAG_COMMIT | PAG_READ | PAG_WRITE);
     136  DosAllocMem((PVOID) &szMsgFileH, CCHMAXPATH,
     137               PAG_COMMIT | PAG_READ | PAG_WRITE);
    133138  // Format caller's message
    134139  va_start(va, pszFmt);
     
    157162          GetPString(IDS_ERRACTION1TEXT + (action - 1)),
    158163          GetPString(IDS_ERRLOCUS1TEXT + (Locus - 1)));
    159 #ifndef HIMEM
    160164  pszMsgStart = szMsg + strlen(szMsg) + 1;
     165  strcpy(szMsgFile, "OSO001.MSG");
     166  strcpy(szMsgFileH, "OSO001H.MSG");
    161167  // Get message leaving space for NL separator
    162   if (!DosGetMessage(NULL, 0L, (PCHAR) pszMsgStart + 1, 1024, ulRC, "OSO001.MSG", &ulMsgLen)
     168  if (!DosGetMessage(NULL, 0L, (PCHAR) pszMsgStart + 1, 1024, ulRC, szMsgFile, &ulMsgLen)
    163169      || !DosGetMessage(NULL, 0L, (PCHAR) pszMsgStart + 1, 1024, ulRC,
    164                         "OSO001H.MSG", &ulMsgLen)) {
     170                        szMsgFileH, &ulMsgLen)) {
     171    DosFreeMem(szMsgFile);
     172    DosFreeMem(szMsgFileH);
    165173    // Got message
    166174    pszMsgStart[ulMsgLen + 1] = 0;      // Terminate
     
    188196    }
    189197  }
    190 #endif
    191198
    192199  return showMsg(mb_type | MB_ICONEXCLAMATION, hwndOwner, GetPString(IDS_DOSERR2TEXT),
Note: See TracChangeset for help on using the changeset viewer.