- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have some F77 code for a dll that was compiled by somebody else. I have the dll and the source code (but not the original compiler). The dll works fine with an Excel application.
I created a new DLL project in IVF 9.0 and added all those files and built the dll. When called from Excel, the functions in the dll execute fine, but on exit I keep getting the error 'Bad DLL Calling Convention'.
I tried changing the calling convention under project project properties but didnt help. What should be the correct convention ?
Thank you.
vikrantca
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You would want "Stdcall, reference" as the convention (or "CVF") for compatibility with Excel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right. I thought so too. But when I set it to STDCALL REFERENCE, but I still get the BAD DLL calling convention error.
Fortran Call :
subroutine SETUPdll(i,hfld,hfm,hrf,ierr,herr)
!DEC$ ATTRIBUTES DLLEXPORT::SETUPdll
!DEC$ATTRIBUTES ALIAS: 'SETUPdll'::SETUPdll implicit double precision (a-h,o-z) implicit integer (i-k,m,n)c Previously the attribute was here
parameter (ncmax=20) character hfld*10000,hfm*255,hrf*3,herr*255,hfmix*255 character*255 hf(ncmax)......
END
Excel Call :
Public Declare Sub SETUPdll Lib "REFPFF" (i As Long, ByVal hfld As String, ByVal hfmix As String, ByVal hrf As String, ierr As Long, ByVal herr As String, ln1 As Long, ln2 As Long, ln3 As Long, ln4 As Long)
thanks.
vikrantca
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hmm - make sure that the String Length Argument Passing is set to "after all arguments".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. Done that already. Still doesnt work.
I have the Code Generation option Generate Reentrant code set to yes. Does this have to do anything with the error ?
thanks
vikrantca
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No. I suggest you send your project and Excel code to Intel Premier Support and we'll take a look. Ask that it be assigned to Steve Lionel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a site where I can download a sample project for fortran dll that is called from VB/Excel ?
thanks
vikrantca
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's one.
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