SteveC
Joined: 27 Mar 2009 Posts: 1
|
Posted: Fri Mar 27, 2009 7:18 pm Post subject: .NET Compact Framework support |
|
|
I am looking for a way to access a Fortran DLL from a Windows Mobile app using the .NET Compact Framework. Is there a way to do this with FTN95?
I am able to compile and access the Fortran DLL using the .NET Framework on a standard Windows machine. But on a mobile device I receive the following error:
Can't find an Entry Point 'HELLO' in a PInvoke DLL 'FortranHelloWorldDLL.DLL'
Below is the code from a Fortran function that outputs a dumb.txt file with the "Hello World" text in it.
FUNCTION HELLO
ASSEMBLY_INTERFACE (name="HELLO")
IMPLICIT REAL*8 (A-H,O-Z)
IMPLICIT INTEGER*2 (I-N)
OPEN (1,FILE='DUMB.TXT')
WRITE (1,2)
2 FORMAT (' Hello World')
CLOSE (1)
RETURN
END
Here is the C# code I used to access it from a Windows Mobile form:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace PPC2003FortranDLL
{
public partial class Form1 : Form
{
[DllImport("FortranHelloDLL.DLL", EntryPoint="HELLO")]
public static extern void HELLO();
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
HELLO();
}
}
}
Am I missing anything? |
|