View previous topic :: View next topic |
Author |
Message |
m.burkhardt
Joined: 02 Sep 2008 Posts: 26
|
Posted: Tue Sep 16, 2008 7:02 am Post subject: Namespace in Fortran DLL .NET |
|
|
Hello I have a question about an Fortran DLL.
!------Fortran Code ----
MODULE MODELL
contains
Subroutine LegBer(c1)
integer*2 c1(10)
integer*2 ca
integer*2 cb
ca = 2
cb = 3
c1(1) = ca * cb
! RETURN
END SUBROUTINE LegBer
END MODULE MODELL
I want to use these DLL within on C# Projekt and load it dynamicaly. So have to know the Namespace. But I don't know the namespace.
How can I get a Namespace in my Fortran Code?
Like:
// C# code
Namespace.MODELL.LegBer(obj);
Michael Burkhardt |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Tue Sep 16, 2008 8:00 am Post subject: |
|
|
The information is given in the help file under .NET Platform->.Net Programming->Using the linker from a command line. The DBKLINK switch is /CC for containing class.
You may also find it helpful to look at your DLL using the Microsoft ILDASM utility. |
|
Back to top |
|
 |
m.burkhardt
Joined: 02 Sep 2008 Posts: 26
|
Posted: Tue Sep 16, 2008 11:26 am Post subject: |
|
|
Thank you for answering! Now I have a Namespace, but when I use the code in my C# Code I get the Exception TargetInvocationException. That means I get an Error in the Constructor.
Du you have any Ideas??
Is it because of using the trail Version of Salford Silverfrost Fortran Net? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Tue Sep 16, 2008 12:44 pm Post subject: |
|
|
The personal edition of FTN95 has no limitations.
The only difference is that, with the personal edition, you get a
message on the screen when you run an application.
I am not sure that you can do what you are attempting to do.
If it is possible then you will need to get the actual name of the Fortran
routine by looking at the ILDASM of the DLL. This will show the internal name of the routine with some sort of prefix to represent the name of the module. There may also be problems when attempting to match the types of the arguments. Again the ILDASM will show you the argument types at both ends of the call. |
|
Back to top |
|
 |
|