PRB: QuickWin Termination Routines and QuickWin GraphicsLast reviewed: July 18, 1995Article ID: Q89909 |
The information in this article applies to:
SYMPTOMSTrying to use the REPLACE.BAT batch file from the Microsoft FORTRAN application note HF0450 "Alternatives to QuickWin Termination Message Box" on a FORTRAN Windows library that has already been configured for use with QuickWin graphics will cause the library utility to generate the following errors:
LIB : error U2155: qwexit : module not in library; ignored LIB : error U2155: qwglob : module not in library; ignored LIB : error U2155: qwiswin : module not in library; ignoredLIB will then generate 44 errors similar to the following:
qwexmode.obj : warning U4151: '__QWINGetExit' : symbol defined in module qwkexmod, redefinition ignored CAUSEThe application note was created before the release of the the QuickWin graphics library. Most of the code in the application note is in the modified QuickWin Windows library, except for an object module, EXITMODE.OBJ, that contains two "wrapper" routines for accessing the routines SETEXITQQ and GETEXITQQ without interface statements. The code is in differently named modules and QWEXIT.OBJ, QWGLOB.OBJ, and QWISWIN.OBJ have already been removed during modification for QuickWin graphics. When the code in the object modules from the application note is added to LLIBFEW.LIB, the symbol redefinition errors occur because the code is already there.
RESOLUTIONDo not run the REPLACE.BAT batch file from the application note. To access the GETEXITQQ and SETEXITQQ routines, there are two options:
MORE INFORMATIONThe actual routines that allow modification of the default exit mode for QuickWin applications are __QWINGetExit() and __QWINSetExit(). The object module EXITMODE.OBJ (included only with the application note) has two wrapper routines (GETEXITQQ and SETEXITQQ) that do nothing but call the __QWIN routines. They are not required if the necessary interface statements are included. For ease of use, some additional information can be added to FGRAPH.FD that allows use of symbolic constants instead of literal constants. NOTE: the two alias contain two consecutive leading underline characters. This may not be apparent in some versions of the text.
Sample Code #1Put the following interface statements in the FGRAPH.FI file:
interface to integer*2 function setexitqq + [c,alias:'__QWINSetExit'](exitmode) integer*2 exitmode[value] end interface to integer*2 function getexitqq + [c,alias:'__QWINGetExit']() end Sample Code #2Put the following information in the FGRAPH.FD file:
INTEGER*2 QWIN$EXITPROMPT INTEGER*2 QWIN$EXITNOPERSIST INTEGER*2 QWIN$EXITPERSIST PARAMETER (QWIN$EXITPROMPT = 1) PARAMETER (QWIN$EXITNOPERSIST = 2) PARAMETER (QWIN$EXITPERSIST = 3) INTEGER*2 GETEXITQQ[EXTERN] INTEGER*2 SETEXITQQ[EXTERN] Sample Code #3The following code illustrates accessing the routines after the above files have been modified:
include 'fgraph.fi' program exitmode include 'fgraph.fd' integer*2 exmode write(*,'(1X,A,/)') 'Please enter the exit mode 1, 2 or 3 ' read(*,*) exmode write(*,'(1X,A,I2)') 'Exit value = ',GETEXITQQ() SELECT CASE (exmode) CASE (1) if( SETEXITQQ( QWIN$EXITPROMPT ) .ne. 0 ) then write(*,*) 'Error returned' endif write(*,'(1X,A,I2)') 'Exit value = ', GETEXITQQ() CASE (2) if( SETEXITQQ( QWIN$EXITNOPERSIST ) .ne. 0 ) then write(*,*) 'Error returned' endif write(*,'(1X,A,I2)') 'Exit value = ', GETEXITQQ() CASE (3) if( SETEXITQQ( QWIN$EXITPERSIST ) .ne. 0 ) then write(*,*) 'Error returned' endif write(*,'(1X,A,I2)') 'Exit value = ', GETEXITQQ() CASE DEFAULT write(*,*) 'Invalid option - checking for bad return' if( SETEXITQQ( exmode ) .ne. -1 ) then write(*,*) 'Error not returned' else write(*,*) 'Correct error return code' endif END SELECT end |
Additional reference words: 5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |