- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a Fortran based DLL hosted in a Windows application. Is there a mechanism to dump the stack trace to a text file?
My suspicion is that the stack trace is written to standard out or standard error and I am not seeing it in release mode because I have no stdout/stderr.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The environment variable "FOR_DIAGNOSTIC_LOG_FILE" can be used to set a log file name.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could follow the instructions in: Adding Console I/O to a Win32 GUI App
Another (untested) hack (try first):
Launch a CMD window, and then from the command line launch the executable (with necessary arguments). The idea with this is, the parent process is the CMD window, which has a console. The hope would be that the spawned process (your app using the DLL) would inherit the file handles (console handles).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And once you have stdout and stderr open, then perhaps the https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/dup-dup2?view=msvc-170
_dup2() function can attach a file to that open file handle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The environment variable "FOR_DIAGNOSTIC_LOG_FILE" can be used to set a log file name.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page