FIX: Access Violation on READ of Exported COMMON Array

Last reviewed: September 18, 1997
Article ID: Q112010
1.00 WINDOWS NT kbtool kbfixlist kberrmsg

The information in this article applies to:

  • Microsoft FORTRAN PowerStation for Windows NT, version 1.0

SYMPTOMS

Attempting to READ an array element that is exported from a COMMON block in a dynamic-link library (DLL) may generate an access violation message box under Windows NT.

CAUSE

This run-time error occurs when the data is read from an external file. This error does not occur with WRITE statements or when reading COMMON variables.

RESOLUTION

READ exported COMMON data into local allocatable arrays, and then assign these arrays to the arrays in the exported COMMON block.

STATUS

Microsoft has confirmed this to be a problem in FORTRAN PowerStation for Windows NT, version 1.0. Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The sample below illustrates the problem:

Sample Code

c MAIN Source Code c Compile options required: none c Linker options required: include the import library for the DLL. c

      interface to subroutine bar[dllimport]()
      end
      common /bridge[dllimport]/ i
      integer*4 i(4)
      open(3,file='main.inp')
      read(3,*) i(1)
      close(3)
      call bar
      end

c DLL Source Code c Compile options required: /LD c
      subroutine bar[dllexport]()
      common /bridge[dllexport]/ i
      integer*4 i(4)
      write(*,*) 'In DLL:'
      return
      end

Contents of main.inp: 1


Additional reference words: 1.00 Dr. Watson imported buglist1.00
KBCategory: kbtool kbfixlist kbbuglist kberrmsg
KBSubcategory: FLIss
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.