- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am new to fortran,I have several fortran77 for (source code) files and a exe for them,I want to build a dll so it can be called by visual basic, can anyone help me how to do it,
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Attached is a sample workspace containing two projects sharing the same code: ZFak.exe and a ZFakDll.dll. (To switch between projects, use Build/SetActiveConfiguration, or, better, right-click on the toolbar and switch on "Build" toolbar).
The code originated from an .exe code which reads data from ulaz.txt, does something with it (I'm not the author, it's something with fluid dynamics) and produces an output file zfak.txt. I used conditional compilation to convert it to dll, so that files are not used, but all input and output goes through the arg-list. (Conditional compilation directives are !DEC$IF DEFINED...!DEC$ENDIF. It means that appropriate parts of the code will or will not be compiled at all. Of course, you don't have to use it, but it illustrates what changes are required).
For connection with VB, see Programmer's Guide, which contains a lot of info for mixed-language programming; see also samples in MIXLANG group. This is also a FAQ in this Forum, so you could do some investigation.
Jugoslav
The code originated from an .exe code which reads data from ulaz.txt, does something with it (I'm not the author, it's something with fluid dynamics) and produces an output file zfak.txt. I used conditional compilation to convert it to dll, so that files are not used, but all input and output goes through the arg-list. (Conditional compilation directives are !DEC$IF DEFINED...!DEC$ENDIF. It means that appropriate parts of the code will or will not be compiled at all. Of course, you don't have to use it, but it illustrates what changes are required).
For connection with VB, see Programmer's Guide, which contains a lot of info for mixed-language programming; see also samples in MIXLANG group. This is also a FAQ in this Forum, so you could do some investigation.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
...attachment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know about you but the first response you got doesn't help me at all! I am in the same boat as you. I have a huge supply of fortran 77 code and I need to get to it from visual basic 6. I have posted the steps necessary to get the foratrn 77 code into a dll project in this faq forum under the posting labelled "using fortran dll from visual basic 6.0 ". In order to call the code from visual basic 6 the on-line instructions in the mixed language programming section of the programmer's guide will work perfectly well once you have chosen the correct project type, and chosen the correct project seetings prior to building the dll. The details are all in my response to "using fortran dll from visual basic 6.0 " in theis forum. Please let me know if you found this useful, since we are presumably in the same boat we may be able to help each other resolve other issues to come.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page