- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm experiencing similar problems to that of https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/272906
When opening a file with a specified unit number in the main program, and then writing to this unit number from a .dll, a new fort.unitNumber file is created. I can not use the solution provided in the above mentioned forum thread, because my main program is a quickwin application, and that using the /libs:dll compiler option breaks the references to any of the quickWin routines. Similarly, I cannot choose \libs:qwin for my dlls.
Is there a way around this problem? Or is writing to already opened files from a .dll not possible when creating a qwin application?
Thank you very much,
Etienne
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, your use of QuickWin makes this not possible.
Perhaps you could pass into the DLL a procedure from your main program that the DLL would call to do I/O? I don't know what the full structure of your program is like.
Is there really a need to use a DLL rather than a static library?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do need a DLL rather than a static library: I want the DLL to be able to change regularly without recompiling the main program.
As for passing into the DLL a procedure from the main program, I would actually have to pass it as an argument to one of the DLL's subroutines? I didn't think I could call a procedure defined in the main program from the DLL, as this seems to introduce circular dependencies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you would pass it as an argument. It's not a link dependency.
If this is something you did a lot, you could keep a set of procedure pointers in the DLL that did the various I/O functions and call an "initialization" routine at the start of the EXE into the DLL to pass the various procedures that it would then save pointers to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Steve, the pointers solution works and is elegant!
Thanks
Etienne
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page