Solved

Basic example calling fortran dll in C#

Posted on 2012-03-15
3
820 Views
Last Modified: 2012-04-09
Hello,

I'm trying to call a fortran sub routine in c#.

I have the following questions:
1. Syntax of calling sub routine
2. How to pass in variables, I read they need to be passed in by reference.
3. Where to specify the fortran version


Is there a basic example

Thanks
0
Comment
Question by:AndyC1000
3 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 37724266
0
 

Author Comment

by:AndyC1000
ID: 37727704
Thanks for the references

In the DllImport tag should I add the path to the dll as well as the name?  I tried to add the dll as a reference to the project although it returned an error stating "please make sure your file is accessible, and that it is a valid assembly or COM component".
0
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 500 total points
ID: 37730125
Add the DLL to your projects (Debug,Release) /bin folder. Then you can write your DllImport() using the DLL name only. When you deploy your application copy the DLL into the same location as your executable or Windows directory or System32 directory these are the search locations your application uses to to locate your library. The recommended way is to add your DLL to the same directory as your executable when deploying.

Can you show us the sub routine?
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video teaches viewers about errors in exception handling.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now