- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What type of project is appropriate to use when making
a fortran dll that is going to be used by visual basic 6.0? Is it the Win32 Dynamic-Link Library type of project? I am using this type of project to build my dll and I am coding in the correct path to the dll in my vb code but I am still getting error 53, "cannot find file". The fortran help says to check the coding of th epath in vb. But my path is not wrong. Is there something else?
a fortran dll that is going to be used by visual basic 6.0? Is it the Win32 Dynamic-Link Library type of project? I am using this type of project to build my dll and I am coding in the correct path to the dll in my vb code but I am still getting error 53, "cannot find file". The fortran help says to check the coding of th epath in vb. But my path is not wrong. Is there something else?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I answerred my own question and am putting this up because it may help others. To make a dll that contains say fortran 77 code such that you can use Visual Basic 6 to call the fortran 77 routines do the following: Using visual studio select File->New->Projects Tab->Win32 Dynamic-Link Library. Name the project and give it a good location then press OK. Accept the option "An empty DLL Project" by pressing Finish. Press OK. Use the Project->Add To Project->New menu-> Files Tab->Fortran Free Format Source File in order to add a new file to the project source files collection. Type in a name for the file and BE SURE to type in the following extension ".F90". Press ok. From the file tab of the workspace view open the dource files folder and double click on the file that you just added. Put all of the DLL coding into this file. Now come the tricky part that should have been included in the Mixed Language Programming of the Programming Guide that ships with Fortran. Before you build the dll (the programmer's guide simply says build it at this point) you have to select from the menu Project->Settings->Fortran Tab. At the top left of is a drop down list box labelled Categories. Select Libraries. Then in the section/frame labelled Fortran Libraries go to the drop down list box labelled Use run-time library and scroll up to select "DEBUG SINGLE THREADED DLL". Please note that if you don't do this, and you build the dll, fortran will build the dll fine. But when you try to call the dll from visual basic 6 you will always get run time error 53- File not found!! This will be frustrating because the on-line help only goes so far as to tell you to be sure that you typed the path to the dll correctly. However, I am sure there are many users out there who are getting error 53 because the instructions in the mixed language programming section of the programmer's guide do not include this important step in the checklist for error 53. Once you have made the settings for the run time library equal to a single threaded dll (or multi threaded dll) you can build the dll and successfully call the routines from visual basic 6!! Happy coding...

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