summaryrefslogtreecommitdiff
path: root/plugins/QuickReplies/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-17 20:53:02 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-17 20:53:02 +0300
commit067a48827e8bae1bc595f3268e18996314843396 (patch)
treed51ae1287c40f08f291f5578b2dccf69f902cc97 /plugins/QuickReplies/src
parent7639f72273189df60566755c0d5f1e4ab7201b67 (diff)
OpenFolder, PackUpdater, PasteIt, Ping, QuickMessages, QuickReplies, Sessions, TranslitSwitcher => CMPlugin
Diffstat (limited to 'plugins/QuickReplies/src')
-rw-r--r--plugins/QuickReplies/src/events.cpp2
-rw-r--r--plugins/QuickReplies/src/options.cpp2
-rw-r--r--plugins/QuickReplies/src/quickreplies.cpp17
-rw-r--r--plugins/QuickReplies/src/stdafx.h9
4 files changed, 18 insertions, 12 deletions
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp
index 23ec25f537..3e5a663eaf 100644
--- a/plugins/QuickReplies/src/events.cpp
+++ b/plugins/QuickReplies/src/events.cpp
@@ -30,7 +30,7 @@ int OnModulesLoaded(WPARAM, LPARAM)
HookEvent(ME_OPT_INITIALISE, OnOptInitialized);
HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
- Icon_Register(hInstance, "TabSRMM/Quick Replies", &icon, 1);
+ Icon_Register(g_plugin.getInst(), "TabSRMM/Quick Replies", &icon, 1);
char buttonNameTranslated[32], buttonName[32];
mir_snprintf(buttonNameTranslated, "%s %x", Translate("Button"), iNumber + 1);
diff --git a/plugins/QuickReplies/src/options.cpp b/plugins/QuickReplies/src/options.cpp
index 29477c53a7..46abcd6ba6 100644
--- a/plugins/QuickReplies/src/options.cpp
+++ b/plugins/QuickReplies/src/options.cpp
@@ -169,7 +169,7 @@ int OnOptInitialized(WPARAM wParam, LPARAM)
odp.szTitle.a = LPGEN("Quick Replies");
odp.szTab.a = tabName;
odp.position = iNumber;
- odp.hInstance = hInstance;
+ odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_PAGE);
odp.pfnDlgProc = DlgProcOptionsPage;
Options_AddPage(wParam, &odp);
diff --git a/plugins/QuickReplies/src/quickreplies.cpp b/plugins/QuickReplies/src/quickreplies.cpp
index 428b0ec6b2..a4718893d7 100644
--- a/plugins/QuickReplies/src/quickreplies.cpp
+++ b/plugins/QuickReplies/src/quickreplies.cpp
@@ -19,10 +19,13 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
-HINSTANCE hInstance = nullptr;
int hLangpack;
+CMPlugin g_plugin;
-PLUGININFOEX pluginInfoEx = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx =
+{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -35,17 +38,13 @@ PLUGININFOEX pluginInfoEx = {
{0xa6a031b6, 0xd32f, 0x4842, {0x98, 0xc6, 0xec, 0x71, 0x6c, 0x57, 0x6b, 0x77}}
};
-BOOL WINAPI DllMain(HINSTANCE hInstanceDLL, DWORD, LPVOID)
-{
- hInstance = hInstanceDLL;
- return TRUE;
-}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
@@ -54,6 +53,8 @@ extern "C" __declspec(dllexport) int Load(void)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
return 0;
diff --git a/plugins/QuickReplies/src/stdafx.h b/plugins/QuickReplies/src/stdafx.h
index d4aadc189d..f56d5845d1 100644
--- a/plugins/QuickReplies/src/stdafx.h
+++ b/plugins/QuickReplies/src/stdafx.h
@@ -23,7 +23,6 @@ Boston, MA 02111-1307, USA.
#include <windows.h>
-#define __NO_CMPLUGIN_NEEDED
#include <newpluginapi.h>
#include <m_utils.h>
#include <m_string.h>
@@ -38,9 +37,15 @@ Boston, MA 02111-1307, USA.
#define MODULE "QuickReplies"
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(MODULE)
+ {}
+};
+
#define MS_QUICKREPLIES_SERVICE MODULE"/Service"
-extern HINSTANCE hInstance;
extern int iNumber;
int OnModulesLoaded(WPARAM wParam, LPARAM lParam);