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

Is DLL location available at run time?

a_leonard
Novice
451 Views
Is there a way to find out, at run time, the path of a DLL containing a function? My code calls routines contained in a DLL that another user may modify and build. If there are multiple versions of the DLL, the one that is actually used depends on where the user puts their DLL. I would like to have the ability to include the full path of the DLL in the output for diagnostic purposes. (And I would like it to work with shared libraries on *NIX.)


0 Kudos
1 Reply
Steven_L_Intel1
Employee
451 Views
Call the Win32 API GetModuleHandle to get a handle for the DLL and then GetModuleFileName on the handle to get the path. This does not extend to *NIX - I have no suggestions for you there.
0 Kudos
Reply