Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Fortran Windows Application

Fortran Windows Application

Fortran Windows Application

I have a console program to do some data processing, but I want to create a Windows GUI version of it.  However, I cannot find any resources online.  Currently I am using Compaq Visual Fortran.

The program reads in 4 files and writes 2 output files.

I am wondering how I can port the current code directly into a fortran windows application with minimal modifications.

I know that I have to use dfwin library to do this, but i am not sure how to get started

RE: Fortran Windows Application

You could use VB to create the interface.
The purpose of the interface being to create the input files needed to run your Fortran program. The Fortran program can be compiled as a *.dll to be called from your VB interface. Output files can be displayed directly in the VB interface.

In Compaq Visusl Fortran, specify the project type as a Fortran dynamic link library project.
In your fortran code replace the

PROGRAM myProgram
SUBROUTINE myProgram(nParam)

Note:- if required(nParam) can be a number of parameters passed from the VB interface

and replace the final

Presumably your existing program reads input files as part of its execution so no changes are needed there. Use you VB application to create the input files to be read by your new myProgram.dll. The output files created by the new dll can be displayed directly in the VB environment if required
Refer to your VB documents for calling and using dll's

RE: Fortran Windows Application

The easiest way for an all-Fortran solution is to use a library aimed at doing that sort of thing for Fortran. For example, the Winteracter package (from ISS Ltd.) gives you Windows interfacing and a pile more. CVF is one of the supported compilers. A "Winteracter Starter Kit (WiSK) comes with the Lahey Fortran compiler; I don't know what might be available in that form for CVF. Gino Menu is another, I believe.

RE: Fortran Windows Application

You could also try http://www.japi.de

It is a Java Interface that works in quite a few languages.  It is ok as long as you are not polling: just sit at j_nextaction and wait for the next thing to be clicked.  Download the examples in both Fortran 77 and 90 and have a play.  It is a very quick way of getting a GUI up as long as you are not after anything sophisticated.

RE: Fortran Windows Application

Creating a DLL from an existing console app is tedious since you would have to take out any print commands and then link the dll to the gui. I did what you need to do once with a Method of Moments code written with CVF. I created a new windows app and copy-pasted al the routines where it usually said "your code here" Then I took out all my print commands and then just played around with the GUI aspects of it. That part is quite straightforward with the help file included with CVF.
The way I see it is that it is the same amount of work but you end up with one code and not a couple (DLL+GUI)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close