Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

FORTRAN DLL 'Optional' Dependency

Intel_C_Intel
Employee
411 Views
I have a FORTRAN DLL that is independant of the EXE that loads and runs it (in this case my FORTRAN/C++ hybrid EXE, but not necessarily so). (i.e., it is loaded by LoadLibrary and has no dependency on the EXE).
The DLL writes a diagnostic file to a path found using GetModuleFilename. The EXE also writes diagnostic files to a path relative to the current 'project' file location. I'm looking at ways to make the DLL write to the EXE diagnostic path.
Firstly, I could pass the path to the DLL, but that would require changing the interface (i.e., the arguments to the single input routine exposed). Since the DLL is in use by third-parties, this will be the last resort!
The EXE diagnostic path is exposed through an exported common block, which I could DLLIMPORT. However, since this would introduce a dependency on the EXE I'm not keen on this approach either (again due to the third-party usage).
My question is...can I, from within the DLL, 'look' for an import from the 'loading' process and use it if it exists, but ignore it if it doesn't? I admit it doesn't even sound possible to me, but others may know different...
0 Kudos
0 Replies
Reply