🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2337

Re: Windows I/O problem

#2337
From: Mike Lipsie
Date: Sat, 27 Apr 1991 19:50
29 lines
1803 bytes
In article <092008.19563@timbuk.cray.com> dre@sequoia.cray.com (Dennis Ellis) writes:
>Greetings all you Win3 programming gurus.
>
>  I have an I/O problem which I hope someone can help me solve.
>
>  I have the usual C main routine (actually the FILEOPEN program from the
>supplied 'samples') which calls a Fortran subroutine. The Fortran routine
>calls some user interface routines which have been included with the main
>C driver. This all works fine under Win3.
>
>  UNTIL ... I attempt to open a file and do I/O in the Fortran routine. I
>get a UAE when I run the resulting EXE. I have tried various combinations
>of 'share' and 'mode' settings on the OPEN statement without much luck.
>
I am _not_ a "Win3 programming guru" (by a long shot;  I'm just getting
into it) but I am a compiler person.

Like most languages, Fortran has an extensive library that needs to be 
initialized.  Either in the code generated from the Fortran MAIN or the 
routine that calls it there is a call to the I/O initialization code.
When you call a Fortran subroutine from a C program, that initialization 
has not happened and who knows what uninitialized pointer you are following.

The solution is either to (a) don't do I/O in the Fortran routines or
(b) find out the calls and put them into your C program.

--
Mike Lipsie
mikel%dosbears.uucp@ingres.com
Technical Details
Message-ID: <231@dosbears>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!pacbell!rtech!dosbears!mikel
References: <092008.19563@timbuk.cray.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!pacbell!rtech!dosbears!mikel
From: mikel@dosbears.UUCP (Mike Lipsie)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Windows I/O problem
Message-ID: <231@dosbears>
Date: 27 Apr 91 19:50:31 GMT
References: <092008.19563@timbuk.cray.com>
Reply-To: dosbears!mikel@ingres.com (Mike Lipsie)
Organization: DOS Bears
Lines: 29