- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm quite new to Fortran. I'm building a project that is composed by a FORTRAN main builded with QuickWin libraries and this main links to some DLL also writed in FORTRAN but with the MultiThread DLL windows libraries. My problem is that I would to be able to call READ and WRITE functions from the DLL and this functions should operate from/to a console created in the main application. For example, if an error occurs iside a DLL this DLL should be able to print into the console the problem just calling WRITE(...).
Is that possible? actually I recive a DebugAssertionFailed message on READ because of _CrtIsValidHeapPointer(pUserData). I know that DLL heaps and EXE heap are different and this is the problem for this assertion but HOW can I make this things works in FORTRAN?
thanks,
Roberto
Is that possible? actually I recive a DebugAssertionFailed message on READ because of _CrtIsValidHeapPointer(pUserData). I know that DLL heaps and EXE heap are different and this is the problem for this assertion but HOW can I make this things works in FORTRAN?
thanks,
Roberto
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, this particular combination is not possible. All QuickWin calls and I/O have to be from the EXE - they cannot be in a DLL. In general, QuickWin and DLLs don't play nice together - it's due to the QuickWin environment needing to statically link to your main program, which thus requires the static libraries. A DLL either links to DLL libraries or has its own copy of the static libraries - either way, it can't play in the QuickWin environment.
If you must use a DLL, you can pass to it a "callback" routine to record any error information. The callback routine would be in your EXE and does the write.
If you find this too restrictive, you'll have to change to using Win32 API for all the "graphics" which is a considerable rewrite, and you'll lose the ability to do Fortran I/O to graphic windows (though a console window will work fine.)
If you must use a DLL, you can pass to it a "callback" routine to record any error information. The callback routine would be in your EXE and does the write.
If you find this too restrictive, you'll have to change to using Win32 API for all the "graphics" which is a considerable rewrite, and you'll lose the ability to do Fortran I/O to graphic windows (though a console window will work fine.)
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