PDA

View Full Version : Can I make a DLL that calls another DLL?


R. T. (Fortran Man)
09-03-2003, 04:58 PM
Can I make a DLL that calls another DLL?

Lahey Support
09-03-2003, 06:22 PM
To make a DLL that calls another DLL, take the following steps:

1. Separate your source code into two files. The first file contains code that is called by the mainline; the second file contains code that calls the other DLL.

2. Compile each file with the switches -c -win -dll -ml <mllib>. Where <mllib> is the mixed-language switch for the type of application to interface with.

3. Link the object files with the switches -win -dll.
Example: to make a Fortran DLL called from Visual Basic that calls Visual C++ use the following commands (file1 takes calls from Visual Basic; file2 makes calls to Visual C++):

lf90 file1 -c -win -dll -ml msvb
lf90 file2 -c -win -dll -ml msvc
lf90 file1.obj file2.obj -win -dll -out file.dll