View previous topic :: View next topic |
Author |
Message |
zenic
Joined: 26 Jul 2007 Posts: 5
|
Posted: Fri Jul 27, 2007 4:16 am Post subject: The questions about C++ to use ftn95 dll |
|
|
I want to use C++ to implement the user interface, and
implement the calculation part with Fortran.
I know I should make Fortran code to be DLL conceptually,but I
don't know what to do in practice.
What directives should I put in the Fortran code?
how to export my subroutine?
and how to call them from C++.NET?
I have installed this Fortran compiler, and it is already integrated in Visaul
Studio .NET 2003.
And can anyone tell me whether it is right?
subroutine demo(m,n,a)
!DLLEXPORT
!ASSEMBLY_INTERFACE (name = "demo");
integer*4 n;
integer*4 m;
integer*4 a;
a = m + n;
return
end subroutine
Thank you very much. ^^ |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Fri Jul 27, 2007 8:19 am Post subject: |
|
|
There is a section on this in FTN95.chm under Win32 Platform->Mixed language programming->Calling FTN95 from C/C++.
Your sample code contains comments that look a little like comment embedded directives. You can use comment embedded directives but they must begin with !FTN95$.
ASSEMBLY_INTERFACE is only for .NET. |
|
Back to top |
|
|
zenic
Joined: 26 Jul 2007 Posts: 5
|
Posted: Fri Jul 27, 2007 10:17 am Post subject: Thank you very much |
|
|
Thanks!
I have found that article, and it helps me a lot.
But may I ask you what is the difference between Win32 and .NET platform,
may I create dll on the .NET platform? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Fri Jul 27, 2007 1:28 pm Post subject: |
|
|
Try typing "What is .NET framework" into Google.
You can create a .NET dll but then you would probably use C# as a first choice or possibly "managed" C++. |
|
Back to top |
|
|
zenic
Joined: 26 Jul 2007 Posts: 5
|
Posted: Mon Jul 30, 2007 8:03 am Post subject: |
|
|
Thank you very much!
I will try it. |
|
Back to top |
|
|
|