Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Comunicados
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Calling Fortran from C#

Thomas_K_1
Principiante
653 Visualizações
Hi,
I am new at mixed programming in .NET and Intel fortran, but I am having serious trouble getting .NET to recognize my .dll as valid. I get a message that the .dll is not a valid .net or com object. I took an old CVF project and tried importing that but got nothing better. Can somebody point me in the right direction. (I've even tried the mixed programming example in IF8 under mixed programming and got nowhere).
Thanx for the help.
Thom
0 Kudos
2 Respostas
anthonyrichards
Novo colaborador III
653 Visualizações
Although this link http://arnholm.org/software/index.htmrefers to calling FORTRAN77 from C++, you may find it very useful. ALong with full documentation, It supplies header files, macros and classes etc. that you need to prototype calls to FORTRAN routines.
g_f_thomas
Principiante
653 Visualizações
To call an unmanaged CVF/IVF dll from managed C# you need to use the P/Invoke technique in conjunction with the InteropServices namespace. Something like:

using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace PInvokeDemo
{
class Class1
[DllImport("MyCVF.dll", EntryPoint="CallMe")]
static extern bool CallMe();

etc, etc.

HTH,
Gerry T.
Responder