- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am a C# developer with little experience in Fortran. I have inherited a C# application which access a Fortran DLL (written / compiled in Intel Visual Fortran Compiler version 11.1).
Everything works fine until an error in the Fortran is encountered.
I have placed a number of Try Catch blocks around the Fortran calls, but the Fortran does not return / see them so the application displays an error and stops processing. I have searched the Internet for a solution but have not really found an answer, most being a few years old.
Can someone point me in the right direction on what needs to be doneto allow errors in the fortran code to return back to the C# application so they can be caught and processed there?
Thank you!
Eric
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your response Steve
As a solution, could the Fortran code be modified to handle the error on that side, then pass these exceptions and simply return a known code that I could grab on the C# side and Know there was an error?
Thanks again!
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which kind of error are you seeing that you want to catch, and what do you want to do with it once it is caught?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Steve, Thanks again.
I know one is the 2GB boundary that I have seen on the internet. I also get other errors an error that there is No Disk in the Drive \device\harddrive2\DR2 Cancel, Try Again, Continue. Another is System.AccessViolationException.
Depending on the parameters that person enters is where I think I get the 2GB limit exception. This application is a model that pulls in a significant amount of data and takes well over 10 30 minutes to run normally. It seems to work fine, has been running for a few years now as a stand-alone. I guess when they hit the errors they simply know to change something. I am now attempting to put it in a console application which is launched from a dedicated system. However, if the Fortran code simply hangs on me that is a problem. Does this help at all?
Since I am not a good Fortran developer and it is not my code, I am not sure what to do with your suggestion, but I will Google it and see if I can figure it out.
Thanks again!
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The "No disk" problem I'm not sure what you can do with, nor what triggers it. It is a Windows prompt that you can't control. As for 2GB limit, at best you'll get an error when trying to allocate memory. It should not cause a hang.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Eric

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