View Full Version : call Fortran.Net data object from C#?
fortrancoder
05-14-2009, 05:59 PM
If I create an object in Fortran.Net and then compile as a DLL, can I then use C# to access that object's data?
________
Mature live (http://www.girlcamfriend.com/webcam/mature-women/)
mposh372
05-19-2009, 01:23 PM
You can access the Fortran.Net variables as long as they are in a module in the Fortran code.
fortrancoder
05-19-2009, 08:01 PM
Any place to find an example of this?
________
LOVE AND SPIRIT CARE CENTER. NORTH HOLLYWOOD (http://www.dispensaries.org/)
tzeis
05-20-2009, 05:53 PM
Make sure the Fortran data are publicly accessible. The module name is the Fortran namespace name. Add a "using" statement to C# for the Fortran namespace and instantiate and use the Fortran class just like you would use any other .Net class object.
mposh372
05-21-2009, 12:22 PM
Here's a simple example to add two numbers. The routine that does the adding is a Fortran routine and the variables are passed from vb to the Fortran routine via the Fortran module.
Note: Because of the path to the reference DLL, this folder should be put in C:\PROGRAMMING. The main folders will then be: C:\PROGRAMMING\TEST\Library1 and C:\PROGRAMMING\TEST\WindowsApplication1.
tzeis
05-24-2009, 12:29 AM
There does not seem to be anything wrong with the code you posted, when I run the VB application and put two numbers into the first two boxes, I get the sum back. The only thing I can think of if you are hitting some snag is this: Making LF 7.1 .NET Work Side by Side with .NET 2.0/VS2005 (http://forum.lahey.com/showthread.php?t=10691). While the subject line says VS2005, it works just as well with VS2008.
Here's a simple example to add two numbers. The routine that does the adding is a Fortran routine and the variables are passed from vb to the Fortran routine via the Fortran module.
Note: Because of the path to the reference DLL, this folder should be put in C:\PROGRAMMING. The main folders will then be: C:\PROGRAMMING\TEST\Library1 and C:\PROGRAMMING\TEST\WindowsApplication1.
Sorry for getting into this thread so late now. Maybe someone has an idea. I have strange behaviour with this program. In VS .NET 2003 I get this project to work. In VS 2008 (wihtout .NET?) not. It might have to do with the project properties in which the platform is set to .NET. This is no option to set .NET within VS 2008. There is only Win32 option. What can I do to have such working code on the VS 2008 machine?
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.