Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

VB2010WindowsFormCallsFortran11Dll

profray
Beginner
198 Views
Hi everyone,
I spent some time searching the forums, both here and "out yonder" and thought I would contribute something that seems to never go out of fashion. The attached zip file contains a VB2010 windows form program that calls an open file dialog, gets the filename, and passes the filename to a Fortran DLL that opens it.
The VB side contains Open File Dialog control, and calls several subroutines from the Fortran DLL
1. Subroutine Hypot - sends two single precision numbers and returns the hypotenuse
2. Subroutine StringAdjust - sends a VB string variable to Fortran DLL which changes it and sends it back
3. Subroutine CharPass - sends a character variable to DLL which changes it and sends it back
4. Subroutine FileWork - takes the filename from Open File Dialog and sends to DLL so DLL can open in
and sends a couple lines to it, then closes it. ***Must have a text file already created so the Open File
Dialog can find it ****...just use Notepad to create a text file (.txt)
5. Subroutine MatMult - Sends two single precision matrices to DLL and returns the solution matrix.

Hope this is helpful. This was tested on VS2010 for the VB2010 part and VS2008 for the Fortran 11 dll.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
198 Views
Thanks for the contribution!
0 Kudos
Reply