- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am calling a fortran console exe from a .NET application. I can record everything that is written to the standard error and standard output streams, but when the fortran program encounters an unexpected"severe error condition" (like a division by zero) the program crashes, and closesand there is no way of seeing the error. Why is this not sent to the standard error stream? Is there a way to at least keep the console window open, or print the error to a file?
(I need the console window to close if there isn't an error, because it calls the routine several times.)
Also I know how to keep it open if running from the IDE, I need to allow the end user to have a good error message, so we can debug it for them.
Thanks
(I need the console window to close if there isn't an error, because it calls the routine several times.)
Also I know how to keep it open if running from the IDE, I need to allow the end user to have a good error message, so we can debug it for them.
Thanks
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could write a tiny helper console application that calls your fortran console exe and then waits for it to exit. When that helper application detects normal termination of the fortran exe (perhaps through a process return code) it exits (and the console will close), when it detects abnormal termination it stays open until the user presses enter or similar.
Alternatively, perhaps your GUI application could use the Windows API to create a console for your fortran exe to inherit and then carry out similar console closing/leave open actions when the fortran exe terminates.
Alternatively, perhaps your GUI application could use the Windows API to create a console for your fortran exe to inherit and then carry out similar console closing/leave open actions when the fortran exe terminates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting IanH
You could write a tiny helper console application that calls your fortran console exe and then waits for it to exit. When that helper application detects normal termination of the fortran exe (perhaps through a process return code) it exits (and the console will close), when it detects abnormal termination it stays open until the user presses enter or similar.
Alternatively, perhaps your GUI application could use the Windows API to create a console for your fortran exe to inherit and then carry out similar console closing/leave open actions when the fortran exe terminates.
Alternatively, perhaps your GUI application could use the Windows API to create a console for your fortran exe to inherit and then carry out similar console closing/leave open actions when the fortran exe terminates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I finally started to convert my programs to QuickWin, it has provided a much better environment when compared to console applications. It is not difficult just recomple after creating a new solution. You could try that.
JMN
JMN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm actually trying to switch away from quickwin, for better portability and hopefully some improved performance due to added multitreading optimization.
Though you are right that in quickwin it is not an issue.

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