Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Basic example calling fortran dll in C#

Posted on 2012-03-15
3
Medium Priority
?
873 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 2000 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

916 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