- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I try to create A DLL since Fortran code and it doesn't work on my Visual studio 2005 C# application...
1 step : I created a DLL Fortran Code named C:\Temp\test\dll.for
----------------------------------------------------------------------------
SUBROUTINE ARRAYTEST()
!DEC$ ATTRIBUTES DLLEXPORT :: ARRAYTEST
REAL(4) arr(3, 7)
INTEGER i, j
DOi = 1, 3
DO j = 1, 7
arr (i, j) = 11.0 * i + j
END DO
END DO
END SUBROUTINE
2 Step : I compile :
------------------------
ifort /dll dll.for
3 Step : A create a C# program
--------------------------------------
usingSystem.Windows.Forms;
using System.Runtime.InteropServices;
namespace testDLL
{
public partial class Form1 : Form
{
[DllImport("dll.dll")]
private extern static void ARRAYTEST();
public Form1()
{
InitializeComponent();
ARRAYTEST();
}but when i execute my program I've an error : unable to load dll 'dll.dll'. (dll was not found).
I put DLL in my solution (as a file because I can't add as a reference) and dll are copied on \debug directory...
Could you help me ?
PS : Why can' i insert DLL.DLL as a reference in my projet ?
I try to create A DLL since Fortran code and it doesn't work on my Visual studio 2005 C# application...
1 step : I created a DLL Fortran Code named C:\Temp\test\dll.for
----------------------------------------------------------------------------
SUBROUTINE ARRAYTEST()
!DEC$ ATTRIBUTES DLLEXPORT :: ARRAYTEST
REAL(4) arr(3, 7)
INTEGER i, j
DOi = 1, 3
DO j = 1, 7
arr (i, j) = 11.0 * i + j
END DO
END DO
END SUBROUTINE
2 Step : I compile :
------------------------
ifort /dll dll.for
3 Step : A create a C# program
--------------------------------------
usingSystem.Windows.Forms;
using System.Runtime.InteropServices;
namespace testDLL
{
public partial class Form1 : Form
{
[DllImport("dll.dll")]
private extern static void ARRAYTEST();
public Form1()
{
InitializeComponent();
ARRAYTEST();
}but when i execute my program I've an error : unable to load dll 'dll.dll'. (dll was not found).
I put DLL in my solution (as a file because I can't add as a reference) and dll are copied on \debug directory...
Could you help me ?
PS : Why can' i insert DLL.DLL as a reference in my projet ?
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page