MATLAB: Use Fortran DLL in Matlab which has no header .h file

dllfortranno header file

Hi together,
my problem is the following. I am using a program called Athena Visual Studio to program a model for a chemical kinetics problem. This program generates the equivalent fortran code and creates the .for and also a .dll file in which Athena specific fortran code is included.
Now I wish to use the DLL file in Matlab R2011b for calling the function in the DLL which calculates the outputs using the passed input arguments.
What I tried so far is to write a .h header file. But I did not managed to so. Therefore I could not use the loadlibrary() function. Actually I don't know whether the DLL is a C based DLL. I guess so because Athena Visual Studio needs Microsoft Visual Studio 2005 and Intel Visual Fortran Compiler or the g95 compiler.
I could call the dll by using a COM.Application server calling an Excel file which declares the function with the Visual Basic Declare function. So I think it is an C based DLL. Am I right?
The code in Excel Visual Basic for Applications:
Option Base 1
Declare Sub myModel Lib "F:\Modellierung\Fluidised_Bed_Model_noOSMOSE\FBM_CORE_TS53_PER_M2.DLL" _
Alias "MYMODEL" (ModelInput As Double, Control As Double, TempProfile As Double, _
ModelOutput As Double, OutputMatrix As Double, _
iDid As Long, flag As Double)
But using the Excel file is not possible for me because I need to run the Matlab code on an Linux Cluster which in fact does not support Windows COM.Applivation server.
Does anybody has an idea for me how to go on?
If I may help you with more information please feel free to ask.
Thanks a lot in advance!! Kind regards
Sinan

Best Answer

As far as I know, you do need to provide a header to load a library in MATLAB (don't know of a way to get around that). You could probably use the "dumpbin" utility that ships with Visual Studio to find the exported function prototypes.
Try:
dumpbin /EXPORTS F:\Modellierung\Fluidised_Bed_Model_noOSMOSE\FBM_CORE_TS53_PER_M2.DLL
From a Visual C++ command window to see if it lists all the exported functions. Then create a header file with this information and try using that in MATLAB.