- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This should be simple but isn't working. I'm trying to test calling a simple DLL created with Intel Fortran. I can call the dll from VB without a problem. I cannot get the Fortran test to call.
Can someone help on this. The setting etc.
Here is the Fortran code:
program main
!DEC$ ATTRIBUTES DLLIMPORT::dllt
INTEGER myi(2,2)
do 20 i=1,2
do 10 j=1,2
myi(i,j) = i*j
10 continue
20 continue
call dllt(myi)
stop
end
And here is the code that created the dll the dll was complied and linked to form the file Dll3.dll
subroutine dllt[STDCALL,REFERENCE]
+ ( myI)
C Specify that the routine name is to be made available to callers
C of the DLL and external name should not have any prefix or suffix
!DEC$ ATTRIBUTES DLLEXPORT :: dllt
INTEGER myI(2,2)
do 20 i=1,2
do 10 j=1,2
myi(i,j) = 10*myi(i,j)
10 continue
20 continue
return
end
Can someone help on this. The setting etc.
Here is the Fortran code:
program main
!DEC$ ATTRIBUTES DLLIMPORT::dllt
INTEGER myi(2,2)
do 20 i=1,2
do 10 j=1,2
myi(i,j) = i*j
10 continue
20 continue
call dllt(myi)
stop
end
And here is the code that created the dll the dll was complied and linked to form the file Dll3.dll
subroutine dllt[STDCALL,REFERENCE]
+ ( myI)
C Specify that the routine name is to be made available to callers
C of the DLL and external name should not have any prefix or suffix
!DEC$ ATTRIBUTES DLLEXPORT :: dllt
INTEGER myI(2,2)
do 20 i=1,2
do 10 j=1,2
myi(i,j) = 10*myi(i,j)
10 continue
20 continue
return
end
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Add this to the main program:
!DEC$ ATTRIBUTES STDCALL,REFERENCE :: dllt
I would also suggest using the same line in your DLL subroutine, removing the [STDCALL,REFERENCE], which is an old Microsoft syntax.
!DEC$ ATTRIBUTES STDCALL,REFERENCE :: dllt
I would also suggest using the same line in your DLL subroutine, removing the [STDCALL,REFERENCE], which is an old Microsoft syntax.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That worked. Thanks.

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