Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fortran dll to be called from Visual basic

Status
Not open for further replies.

carlasilva

Programmer
Jan 6, 2003
12
PT
How do I build the dll from fortran to be called within Visual basic interface?

Thank you for your help
 
It depends on the capabilities of your Fortran compiler. Easiest is to have it produce a COM DLL (rather unlikely, given that it's Fortran).

Next easiest is for it to produce a Win32 DLL, with the exported functions using the dllexport (aka stdcall) calling convention (somewhat more likely).

Check your compiler documentation under "Windows interoperability".

Chip H.
 
I've done this with both DEC and Lahey compilers, it's not well written up in the DEC manual but Lahey has all you need. you basically need to replace your program statement with a subroutine statement and add an export line (or 2 for DEC). then just declare the dll in vb as you would any other dll and it's there for your use.
 
And how can I pass by reference a two dimentional array from vb 6 to visual fortran dll?

Thank you very much for your help.
carla
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top