I want to get a dll\'s directory (or file) path from within its code. (not the program\'s .exe file path)
I\'ve tried a few methods I\'ve found:
GetModuleFileName() works fine from inside the DLL's codes. Just be sure NOT to set the first parameter to NULL, as that will get the filename of the calling process. You need to specify the DLL's actual module instance instead. You get that as an input parameter in the DLL's DllEntryPoint() function, just save it to a variable somewhere for later use when needed.