- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I created a Fortran DLL and I use it on C# application (VS2005). I generate an application error on my C# program and I want to trap it but the following code dosen't work. Could you explain me why ?
C# code:
[DllImport("dll1.dll")]
public static extern void ARRAYTEST(
[MarshalAs(UnmanagedType.LPArray)] int[,] arr,
[MarshalAs(UnmanagedType.I4)]int len);
...
int[,] entiers = new int[3, 7];
try
{
ARRAYTEST(entiers, 10); ====> Error because 10 corresponding of my first bound of my array 'entiers' and the max value is 3 (int[3,7])...
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\n" + ex.Source + "\n" + ex.InnerException + "\n" + ex.StackTrace);
}
This code dosen't work : the program print an error windows in line 'ARRAYTEST(entiers, 10);' and it stoped... the prog dosen't continue on my catch...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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