FORTRAN 5.1 README.DOC: Windows Programming

ID: Q73258


The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, version 5.1
  • Microsoft FORTRAN for OS/2, version 5.1


SUMMARY

The following is the "Windows Programming" section from the FORTRAN version 5.10 README.DOC:


                            README.DOC File
              Release notes for the Microsoft(R) FORTRAN
             Professional Development System, Version 5.1

This document contains release notes for version 5.1 of the Microsoft
FORTRAN Professional Development System for MS-DOS(R) and the
Microsoft Operating System/2 (MS(R) OS/2). The information in this
document is more up-to-date than that in the manuals and the Microsoft
Advisor (online help).

Microsoft improves its languages documentation at the time of
reprinting, so some of the information in this file may already be in
your manuals.

===========< FORTRAN Programming with Microsoft Windows >============

Requirement for Windows Dynamic-Link Libraries
----------------------------------------------

All FORTRAN 5.1 dynamic-link libraries (DLLs) must explicitly export
the symbol WEP. To do this, the statement

     EXPORTS
         WEP

should be added to the DLL's module definition file. The WEP routine
is included in the FORTRAN 5.1 startup code. If a DLL already has a
user-defined WEP routine (for example, in a mixed-language DLL with
existing C code), the WEP routine should be renamed _WEP. The FORTRAN
5.1 startup code will call _WEP, if present, during DLL termination.
For additional information concerning the WEP function, see the
Windows 3.0 SDK documentation.

Close All Files Before Exiting a Windows DLL
--------------------------------------------

When a Windows DLL written in FORTRAN terminates, any information
left in a file output buffer will be lost. This is a result of how
DLLs are terminated in Windows. To ensure that all data is written to
a file, explicitly CLOSE any open files in a DLL before the DLL is
terminated. One way of doing this is by adding a function to the DLL
code that closes all files, and calling this function just before the
application terminates.

MessageBox Support
-------------------

FORTRAN supports two modes of MessageBox for QuickWin applications,
TASKMODAL and SYSTEMMODAL.  TASKMODAL requires that you respond to
the message box before the application will perform any further
calculations; however, all other applications currently running will
not be affected. SYSTEMMODAL requires you to respond before any
application may run.

Maximizing Windows
------------------

To maximize the frame window of a QuickWin application, place the
following statement in the WIN.INI file:

     [<appname>]
     QWINMaximized=1

where <appname> is the base name of your executable file. For
example, if the executable file is called PROGRAM.EXE, the value for
<appname> would be PROGRAM.

Windows DLLs and Subprograms with String Arguments
--------------------------------------------------

Don't pass char*(*) arguments to a subprogram residing in a Windows
DLL. This is because the runtime in the calling DLL or EXE cannot
communicate the length of the string with the runtime in the called
DLL.

*****************  NOTE: *****************

The above paragraph in the README.DOC contains an error. char*(*)
should be replaced by character*(*). 

Additional query words: 5.10

Keywords :
Version : :5.1
Platform :
Issue type :


Last Reviewed: November 1, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.