diff --git a/lv2/vstgui_helpers.cpp b/lv2/vstgui_helpers.cpp index 4e8969f6..43ff0901 100644 --- a/lv2/vstgui_helpers.cpp +++ b/lv2/vstgui_helpers.cpp @@ -15,6 +15,9 @@ #include #include #endif +#if WINDOWS +#include +#endif #if LINUX void Lv2IdleRunLoop::execIdle() @@ -168,3 +171,16 @@ void VSTGUI::initializeSoHandle() VSTGUI::soHandleInitialized = true; } #endif + +/// +#if WINDOWS +void* hInstance = nullptr; + +__declspec(dllexport) +BOOL WINAPI DllMain(HINSTANCE dllInstance, DWORD reason, LPVOID) +{ + if (reason == DLL_PROCESS_ATTACH) + hInstance = dllInstance; + return TRUE; +} +#endif