The information in this article applies to:
SYMPTOMSRunning a QuickWin application created by Microsoft FORTRAN version 5.1 for MS-DOS and OS/2 that outputs a large quantity of output to a child window, and then selecting a large amount of the output and choosing Copy from the Edit menu, may cause a general protection (GP) fault under Windows 3.1 or an unrecoverable application error (UAE) under Windows 3.0. If a smaller (yet still large) region is selected, a dialog box may be generated with the following error:
CAUSEThe Copy menu item does a call to the Windows GlobalAlloc() API to allocate memory from the global heap. QuickWin applications calculate the size of the allocation by using a RECT Windows structure containing the dimensions of the selection. The elements of this structure are only 2-byte integers and when a very large region of text is selected, the integer values overflow. The resulting handle returned from the GlobalAlloc() function is invalid. The subsequent attempt to use the allocated memory causes a GP fault. The QWIN Warning dialog box is generated when the size of the selection is small enough to not overflow the integer elements of the RECT structure but too big for GlobalAlloc() to succeed. RESOLUTIONDo not attempt to copy extremely large areas of text in a QuickWin application child window at one time. Select and copy smaller regions. STATUSMicrosoft has confirmed this to be a problem in Microsoft FORTRAN version 5.1 for MS-DOS and Windows. This problem was corrected in FORTRAN PowerStation. MORE INFORMATIONSample Code
Note that the text must be written to an explicitly opened child window. If
it is written to UNIT * then it will scroll off at the top of the window
and the window will never contain sufficient information to reproduce the
error.
Additional query words: 5.10 gp-fault
Keywords : |
Last Reviewed: November 1, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |