replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Namespace in Fortran DLL .NET
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Namespace in Fortran DLL .NET

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
m.burkhardt



Joined: 02 Sep 2008
Posts: 26

PostPosted: Tue Sep 16, 2008 7:02 am    Post subject: Namespace in Fortran DLL .NET Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8217
Location: Salford, UK

PostPosted: Tue Sep 16, 2008 8:00 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
m.burkhardt



Joined: 02 Sep 2008
Posts: 26

PostPosted: Tue Sep 16, 2008 11:26 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8217
Location: Salford, UK

PostPosted: Tue Sep 16, 2008 12:44 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group