Solved

Basic example calling fortran dll in C#

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

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

821 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