This sample demonstrates how to call a Fortran DLL from Visual BASIC.NET and how to pass simple arguments.

System Requirements:
Build Instructions:
For Visual Studio IDE users:
  1. Open Visual Studio and load the solution .sln file
  2. If project ""VBCallsFortran" " is not shown in boldface type in the Solution Explorer, right-click on project ""VBCallsFortran" " and select "Set as StartUp Project".
  3. Clean the solution from menu Build > Clean Solution
  4. Build the project from menu Build > Build Solution
  5. Run the application from menu Debug > Start Without Debugging or press Ctrl-F5

    A "Do It" button will be displayed along with four input values. Click the button. The VB code will call the Fortran routine DLL_ROUT and pass it a double precision real input array, a string, and a double-precision output array. The Fortran code uses an internal READ to convert the string to a number, multiplies it by the values in the input array, and then stores the result in the output array.

For Command line users:
  1. Open the Intel Visual Fortran Build Environment window from Start menu and navigate to the sample folder
  2. Use following commands to build and test:
    1. Clean the build folder use: build.bat clean
    2. To build a release version: build.bat release
    3. To build a debug version: build.bat debug
    4. To run the program:
      1. Build the VB project VBCallsFortran in Visual Studio IDE
      2. Manually copy the Fcall.dll built from above steps under directory .\debug or .\release to the VB project output folder VBCallsFortran\bin\Debug or VBCallsFortran\bin\Release
      3. Run VBCallsFortran\bin\Debug\VBCallsFortran.exe or VBCallsFortran\bin\Release\VBCallsFortran.exe from the command window
Detail Notes: