From 58fe6fb1156ffddc377f965ee4360aca6a3034d0 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 31 Aug 2020 11:38:23 +0200 Subject: [PATCH] Define DllMain for VSTGUI --- lv2/vstgui_helpers.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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