Solved

Basic example calling fortran dll in C#

Posted on 2012-03-15
3
851 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This video teaches viewers about errors in exception handling.
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…

623 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