Getting path of loaded VST plugin DLL


To be able to make File::getSpecialLocation(File::currentExecutableFile) return the path to the loaded DLL instead of the host executable, I added this in juce_VST_wrapper.cpp:

    BOOL WINAPI DllMain(
        HINSTANCE hinstDLL,  // handle to DLL module
        DWORD fdwReason,     // reason for calling function
        LPVOID lpReserved )  // reserved
        switch( fdwReason ) 
        case DLL_PROCESS_ATTACH:
        return TRUE;

I don't know if it can be used elsewhere for JUCE DLL builds ?


Uh! Saw the documentation. I'm doing it my own plugin init code now.