From 8a74e7495ce5ad39de4f5c25121a84d35df90c36 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 May 2018 15:08:48 +0300 Subject: CMPlugin to receive a reference to PLUGININFOEX --- plugins/Boltun/src/boltun.cpp | 44 ++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'plugins/Boltun/src/boltun.cpp') diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 6f7564d1e3..81b6ef8de6 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -32,7 +32,17 @@ BOOL blInit = FALSE; UINT pTimer = 0; wchar_t tszPath[MAX_PATH]; -PLUGININFOEX pluginInfo = { +static HGENMENU hMenuItemAutoChat, hMenuItemNotToChat, hMenuItemStartChatting; + +#define MIND_DIALOG_FILTER L"%s (*.mindw)\1*.mindw\1%s (*.*)\1*.*\1" + +#ifdef DEBUG_LOAD_TIME +#include +#endif + +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -42,16 +52,19 @@ PLUGININFOEX pluginInfo = { __AUTHORWEB, UNICODE_AWARE, // {488C5C84-56DA-434F-96F1-B18900DEF760} - { 0x488c5c84, 0x56da, 0x434f, { 0x96, 0xf1, 0xb1, 0x89, 0x0, 0xde, 0xf7, 0x60 } } +{ 0x488c5c84, 0x56da, 0x434f,{ 0x96, 0xf1, 0xb1, 0x89, 0x0, 0xde, 0xf7, 0x60 } } }; -static HGENMENU hMenuItemAutoChat, hMenuItemNotToChat, hMenuItemStartChatting; +CMPlugin::CMPlugin() : + PLUGIN(BOLTUN_KEY, pluginInfoEx) +{} -#define MIND_DIALOG_FILTER L"%s (*.mindw)\1*.mindw\1%s (*.*)\1*.*\1" +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} -#ifdef DEBUG_LOAD_TIME -#include -#endif +///////////////////////////////////////////////////////////////////////////////////////// void UpdateEngine() { @@ -156,14 +169,6 @@ static bool LoadMind(const wchar_t* filename, int &line) return true; } -/*static bool SaveMind(const wchar_t* filename) -{ -if (!bot) -return false; -bot->GetMind().Save(filename); -return true; -}*/ - static bool BoltunAutoChat(MCONTACT hContact) { if (db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT @@ -513,14 +518,9 @@ static int MessagePrebuild(WPARAM hContact, LPARAM) return 0; } -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) -{ - return &pluginInfo; -} - extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); GetModuleFileName(g_plugin.getInst(), tszPath, _countof(tszPath)); *(wcsrchr(tszPath, '\\') + 1) = '\0'; @@ -568,6 +568,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0; } +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" int __declspec(dllexport) Unload(void) { if (pTimer) -- cgit v1.2.3