Silverfrost Forums

Welcome to our forums

Namespace in Fortran DLL .NET

16 Sep 2008 6:02 #3816

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

16 Sep 2008 7:00 #3818

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.

16 Sep 2008 10:26 #3821

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?

16 Sep 2008 11:44 #3822

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.

Please login to reply.