From 86ce33563c240d57aa3f8974a801aaa75cbb548a Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 16 May 2018 15:21:16 +0300 Subject: BASS_interface: cmplugin adaptation --- plugins/BASS_interface/src/Main.cpp | 16 +++++----------- plugins/BASS_interface/src/stdafx.h | 9 +++++++-- 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'plugins/BASS_interface/src') diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index a7277ed097..f2d0e60a1f 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -30,7 +30,7 @@ FARPROC WINAPI delayHook(unsigned dliNotify, PDelayLoadInfo dli) extern "C" PfnDliHook __pfnDliNotifyHook2 = delayHook; -HINSTANCE hInst; +CMPlugin g_plugin; int hLangpack; CLIST_INTERFACE *pcli; @@ -47,12 +47,6 @@ PLUGININFOEX pluginInfo = { { 0x2f07ea05, 0x05b5, 0x4ff0, { 0x87, 0x5d, 0xc5, 0x90, 0xda, 0x2d, 0xda, 0xc1 } } }; -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) -{ - hInst = hinstDLL; - return TRUE; -} - extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfo; @@ -314,7 +308,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara int OptionsInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = hInst; + odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = ModuleName; odp.pfnDlgProc = OptionsProc; @@ -443,13 +437,13 @@ void CreateFrame() WNDCLASS wndclass = { 0 }; wndclass.lpfnWndProc = FrameWindowProc; - wndclass.hInstance = hInst; + wndclass.hInstance = g_plugin.getInst(); wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW); wndclass.lpszClassName = L"BassInterfaceFrame"; RegisterClass(&wndclass); hwnd_plugin = CreateWindow(L"BassInterfaceFrame", TranslateT("BASS Interface"), - WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, pcli->hwndContactList, nullptr, hInst, nullptr); + WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr); CLISTFrame Frame = { sizeof(CLISTFrame) }; Frame.tname = TranslateT("BASS Interface"); @@ -603,7 +597,7 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnSettingChanged); - Icon_Register(hInst, ModuleName, iconList, _countof(iconList)); + Icon_Register(g_plugin.getInst(), ModuleName, iconList, _countof(iconList)); return 0; } diff --git a/plugins/BASS_interface/src/stdafx.h b/plugins/BASS_interface/src/stdafx.h index d804face02..306c6a5a88 100644 --- a/plugins/BASS_interface/src/stdafx.h +++ b/plugins/BASS_interface/src/stdafx.h @@ -8,8 +8,6 @@ Copyright (C) 2010, 2011 tico-tico #include #include -#define __NO_CMPLUGIN_NEEDED - #include #include #include @@ -29,6 +27,13 @@ Copyright (C) 2010, 2011 tico-tico #define ModuleName LPGEN("BASS Interface") +struct CMPlugin : public PLUGIN +{ + CMPlugin() : + PLUGIN(ModuleName) + {} +}; + #define OPT_VOLUME "Volume" #define OPT_BASSPATH "PathToDll" #define OPT_MAXCHAN "MaxChannels" -- cgit v1.2.3