The information in this article applies to:
SYMPTOMS
Opening a file from within a Windows DLL (dynamic-linked library) created
with FORTRAN 5.1 may incorrectly branch to the ERR label specified in the
OPEN statement.
CAUSEThe problem occurs because of a call within the LDLLFEW.LIB library to an internal routine called __FCchfr. Following the call to this routine, the AX register becomes corrupted and the ERR label is branched to, even though the file was successfully opened. The IOSTAT variable also contains incorrect information after the OPEN operation. The same code compiled as an MS-DOS executable, an OS/2 executable, or an OS/2 DLL does not produce the run-time problem. RESOLUTIONTo avoid this problem, use a temporary CHARACTER variable to assign the result from the concatenation and substring operations. Then use this temporary variable as the filename in the OPEN statement. STATUS
Microsoft has confirmed this to be a problem in the library LDLLFEW.LIB
shipped with Microsoft FORTRAN version 5.1.
MORE INFORMATIONSample codes 1 and 2 together reproduce the problem. The solution suggested is demonstrated in sample code 3. Sample Code 1This is the source code for the SAMPLE.FOR file:
Sample Code 2This is the code for the SAM_DLL.FOR file:
Sample Code 3This is the code for the DLL with the suggested solutions:
Additional query words: 5.10
Keywords : |
Last Reviewed: November 6, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |