From 88b04fed4966b0f1686690cb6101854afb52a5ee Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 17 May 2018 21:37:53 +0300 Subject: Db3x_mmap, Dbx_mdbx, Exchange, MyDetails, RecentContacts, TopToolBar, WebView => CMPlugin --- plugins/Rate/src/main.cpp | 23 ++++++++++++++--------- plugins/Rate/src/stdafx.h | 6 ------ 2 files changed, 14 insertions(+), 15 deletions(-) (limited to 'plugins/Rate/src') diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp index f0df6cdaa6..0e6d3a20ca 100644 --- a/plugins/Rate/src/main.cpp +++ b/plugins/Rate/src/main.cpp @@ -35,11 +35,20 @@ #include "stdafx.h" -HINSTANCE g_hInst; - static HANDLE hExtraIcon = nullptr; + +struct CMPlugin : public PLUGIN +{ + CMPlugin() : + PLUGIN(MODULENAME) + {} +} +g_plugin; + int hLangpack; +/////////////////////////////////////////////////////////////////////////////// + PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), @@ -54,12 +63,6 @@ PLUGININFOEX pluginInfo = {0x45230488, 0x977b, 0x405b, {0x85, 0x6d, 0xea, 0x27, 0x6d, 0x70, 0x83, 0xb7}} }; -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) -{ - g_hInst = hinstDLL; - return TRUE; -} - // плагининфо extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { @@ -123,13 +126,15 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); // IcoLib support - Icon_Register(g_hInst, LPGEN("Contact rate"), iconList, _countof(iconList)); + Icon_Register(g_plugin.getInst(), LPGEN("Contact rate"), iconList, _countof(iconList)); // Extra icon support hExtraIcon = ExtraIcon_RegisterIcolib("contact_rate", LPGEN("Contact rate"), "rate_high"); return 0; } +/////////////////////////////////////////////////////////////////////////////// + extern "C" int __declspec(dllexport) Unload(void) { return 0; diff --git a/plugins/Rate/src/stdafx.h b/plugins/Rate/src/stdafx.h index f8b23375a5..9226bf1c7a 100644 --- a/plugins/Rate/src/stdafx.h +++ b/plugins/Rate/src/stdafx.h @@ -18,12 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMHEADERS_H -#define COMMHEADERS_H - #include -#define __NO_CMPLUGIN_NEEDED #include #include #include @@ -34,5 +30,3 @@ #include "version.h" #define MODULENAME "Rate" - -#endif //COMMHEADERS_H -- cgit v1.2.3