BUG: READ w/ Numeric Literal Subscript Causes Access ViolationLast reviewed: July 12, 1995Article ID: Q130807 |
The information in this article applies to:
SYMPTOMSExporting an array in a COMMON block from a dynamic-link library (DLL) and attempting to read a member of the array by using a numeric literal as a subscript in the READ statement may generate an access violation.
RESOLUTIONHere are two ways to work around this problem:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThis error occurs only with READ statements. It does not occur with WRITE statements or when reading COMMON variables.
Sample Code to Reproduce ProblemC The code for the DLL C Compile options needed: /LD C COMMON /TheBlock[DLLEXPORT]/ CommonBlockIntegerArray(3) INTEGER*4 CommonBlockIntegerArray CommonBlockIntegerArray(1) = 1 CommonBlockIntegerArray(2) = 2 CommonBlockIntegerArray(3) = 3 ENDC C The code for the EXE. C Compile options needed: none C Linker options needed: include the import library for the DLL C C Define the common block for sharing. C COMMON /TheBlock[DLLIMPORT]/ CommonBlockIntegerArray(3) INTEGER*4 CommonBlockIntegerArrayC C Some local variables. C INTEGER*4 intTemp CHARACTER*3 someTextC C The main program. C someText = '11' intTemp = 1C C If the subscript is an integer variable, there is no problem. C READ (someText, '(A3)') CommonBlockIntegerArray(intTemp)C C The array subscript is a numeric literal, an access violation occurs. C READ (someText, '(A3)') CommonBlockIntegerArray(1) END REFERENCESFor information on a related problem, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q112010 TITLE : BUG: Access Violation on READ of Exported COMMON Array |
Additional reference words: 1.00 Dr. Watson imported
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |