It is well known that Fortran is stronger than numerical calculations, especially if the calculation is mainly for complex, Fortran is more unparalleled. Fortran is the only language that defines the complex as a standard data type in all languages. However, the Fortran language is very lacking in visualization programming, at least no manufacturer has launched a Fortran compilation integrated development environment with RAD characteristics. Therefore, after a large scientific calculation is implemented with Fortran, it is difficult to convert this calculation into data input, and the result shows the convenient Windows visualization application. This is easy to implement by Delphi. Therefore, in many cases, mixed programming using Fortran and Delphi can be the advantage of both. This paper uses two different methods to achieve hybrid programming. One is how to perform executable files is a way to call the dynamic link library. In the first mode, execute the FORTRAN program execution file directly in the Delphi program, data exchange is performed by a file; in the second case, first compile the FORTRAN program into a dynamic link library (DLL), in the Delphi program In the design, call a subroutine in this dynamic link library to complete a certain calculation. These two ways have advantages and disadvantages. The first way is more simple, and there is no mismatch problem of data types between different languages. However, in this way, the effective supervision of the program operation cannot be achieved in Delphi, and the data exchange is not very convenient in operation with documentation, and the efficiency is not high. The second way is integrated with the difference between the two programs. If the program is successful, the program is running can not see the marking of mixed language programming, but this way is commissioned to be particularly troublesome. Generally speaking, the first method can be considered for the existing input and output, which can be considered, and for relatively simple, or new programs prepared by themselves, it can be used.
1. Perform executable file (exe)
The API function WINEXEC is available in Windows to perform existing execution files. This function is defined as:
UINT WINEXEC (LPCSTR LPCMDLINE, UINT UCMDSHOW);
The parameter description is as follows: LPCSTR LPCMDLINE: Contains the command line to be executed.
The system will find applications in the following range: 1 Application Start Location 2 Current Directory Location 3Windows System Directory 4Windows Directory 5path Settings Path list UINT UCMDSHOW: Defines the constant value of the program in what form. Specifically, the following: SW_HIDE hides the window, the active state gives a window SW_MINIMIZE to minimize the window, the active state gives a window SW_RESTORE to display a window with the original size and position, while entering the active state SW_SHOW with the current size and location display One window, simultaneously enters the active Sw_ShowMaximized to maximize the window, activate the sw_showminimized minimization window, and activate SW_SHOWMINNOACTIVE minimize a window, and does not change the active window sw_showna display a window with the current size and location, no Change the activity window SW_SHOACTIVATE to display a window with the nearest sizes and locations, and do not change the active window SW_SHOWNORMAL. If the STR is the path and file name variable of the executable file, Winexec (Str), SW_SHOWNORMAL) is represented. The executable is executed under normal conditions.