Finding path to DLL


My VSTi has a folder with samples, but I’m struggling to find a way to find it in a consistent fashion. I expect the DLL and the wave folder to be kept in the same place.

just going “/waveFolder/” + filename, seems to work sometimes.
Getting CWD from juce also works sometimes. (I think juce just converts a relative path using CWD anyway.)

With some hosts it works, with others it returns the host exe directory. If I run it in the debugger it returns the project root folder.

So, is there a way for a DLL to find out the path to itself?

(Otherwise, I do a thing where it tries to get it by CWD but if that fails, it pops up a file selector box.)


Yep - check out the File::currentExecutableFile enum…


Oh, I’ll be darned! Never bothered to look at the enums. :lol: