Solved

Basic example calling fortran dll in C#

Posted on 2012-03-15
3
821 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

910 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

21 Experts available now in Live!

Get 1:1 Help Now