- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I need make a DLL in Fortran in order to use some
functions (procedures) in Delphi
my Fortran Source Code (sample) is
! Fortran part of a Fortran DLL example. This
SUBROUTINE SUMAR(X, Y, R)
! Specify that SUMAR is exported to a DLL
! and that the external name is 'SUMAR'
!DEC$ ATTRIBUTES DLLEXPORT :: SUMAR
!DEC$ ATTRIBUTES ALIAS:'SUMAR' :: SUMAR
IMPLICIT NONE
INTEGER X,Y,R
Y = X * 2
R = X * 4
RETURN
END
but, when i Try to use in Delphi, it produces a access violation runtime error;
can anybody help me please
I need make a DLL in Fortran in order to use some
functions (procedures) in Delphi
my Fortran Source Code (sample) is
! Fortran part of a Fortran DLL example. This
SUBROUTINE SUMAR(X, Y, R)
! Specify that SUMAR is exported to a DLL
! and that the external name is 'SUMAR'
!DEC$ ATTRIBUTES DLLEXPORT :: SUMAR
!DEC$ ATTRIBUTES ALIAS:'SUMAR' :: SUMAR
IMPLICIT NONE
INTEGER X,Y,R
Y = X * 2
R = X * 4
RETURN
END
but, when i Try to use in Delphi, it produces a access violation runtime error;
can anybody help me please
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What's the Delphi declaration of it? It should be:
Jugoslav
procedure SUMARvar x: Integer; var y: Integer, var r: Integer); stdcall; external 'yourdll.dll' name 'SUMAR';(Maybe it could be written more succinctly, but I'm not sure about Delphi parsing rules so I went on the safe side). The keys are "stdcall" and "var" (by reference).
Jugoslav
![](/skins/images/98E68944C1FF703B8AC50091329B92AF/responsive_peak/images/icon_anonymous_message.png)
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