Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Calling dll from Excel CVF/IVF

sabur
Beginner
1,637 Views
I just recently purchased IVF 9.1 PRO and VS 2005.
I have searched this forum and tried googling but I still cannot solve the following problem:
I have a CVF 5 dll that is called from an Excel macro. I'm trying to port this to IVF 9.1. The dll is not that large so I simply created a new dll application in IVF and cut and pasted the source code from CVF to IVF. I created a new folder for the IVF version of this dll and changed the project name slightly to avoid confusion with names.I was able to get the build process to work without too much trouble (boy did that feel good). I then went through the Excel code and changed the paths and names in my "Declare" statements.
When I run the Excel code it comes to the first Call statement that needs the dll and I geta "Run-time error53" and a file not found message.
I have taken great pains to make sure the path/file namesin the Declare statements are correct. I originallyopened upthe properties window for the dll in Windows (XP SP2) andcut and pasted the path intotheExcel Declare line and then of coursetyped in the dll's name. I havecut and pasted both thepath/file name in the error message and the path/file namein my Declare statements, put them side by side in a text editor and compared them. I don't see any difference.
One other thing I did which may help narrow things down. I copied the CVF dll and pasted it in the IVF debug directory and changed the name to match the one I'm using in IVF. It successfully got past the first call to the dll without complaining. It hung up on the second one; a different subroutine in the dll but I"ll deal with that later. I'd just like to get the Excel code tofind the IVF version of the dll. Seems there's something I need to do on the IVF side. I'm using the same computer for both versions.
Keep in mind I'm just an engineer who knows how to program a little in FORTRAN. All this Visual Studio environment stuff is still a little fuzzy.
Thanks
Mike
0 Kudos
46 Replies
Steven_L_Intel1
Employee
156 Views

Can you do a File > Save in Dependency Walker and attach a ZIP of the .dwi file? The screenshot doesn't tell the whole story. I'll note that Dependency Walker doesn't understand that Windows skips over "wrong architecture" DLLs.

0 Kudos
Bin_X_
Beginner
156 Views

Thx. Steve. Attached is the dwi file. Thanks for the help. 

0 Kudos
Steven_L_Intel1
Employee
156 Views

Ok. It seems that you copied some Intel DLLs to e:\mydata\programs\ior-stress-calculation-bundle\calling_fortran_vba\testdll\testdll\debug\  When you run things from VS this may be seen, but Excel won't, These are MKL DLLs. We don't put the MKL DLLs in PATH by default, but you should do so since you are using MKL indirectly through IMSL. Add C:\Program Files (x86)\Intel\Composer XE 2015\mkl\lib\ia32 to PATH.

0 Kudos
Bin_X_
Beginner
156 Views

Thanks very much, Steve! It works. I added: C:\Program Files (x86)\Intel\Composer XE 2015\mkl\lib\ia32 and C:\Program Files (x86)\Intel\Composer XE 2015\redist\ia32\mkl to my PATH.

By the way, the Dependency Walker is stilling telling me that API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL ... is missing. Any concerns for this?

Thanks!

0 Kudos
Steven_L_Intel1
Employee
156 Views

I don't think that's anything to worry about.

0 Kudos
Reply