diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-17 18:23:34 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-17 18:23:34 +0300 |
commit | 2aa59179945482dee30935c991f9317dfbf31946 (patch) | |
tree | 49fc2b77d68b636c7842a1af462af59c94ff6da5 /plugins/StopSpamPlus | |
parent | 4c4735a232c680e60a85d0f85e2cb392e012c6e0 (diff) |
Tipper, StopSpamMod, StopSpam, StatusManager, StatusChange, StartupSilence, StartPosition, SplashScreen, SpellChecker, Spamotron => CMPlugin
Diffstat (limited to 'plugins/StopSpamPlus')
-rw-r--r-- | plugins/StopSpamPlus/src/options.cpp | 6 | ||||
-rw-r--r-- | plugins/StopSpamPlus/src/stdafx.h | 10 | ||||
-rw-r--r-- | plugins/StopSpamPlus/src/stopspam.cpp | 13 |
3 files changed, 15 insertions, 14 deletions
diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp index db5d0f6588..9ecf9d5cae 100644 --- a/plugins/StopSpamPlus/src/options.cpp +++ b/plugins/StopSpamPlus/src/options.cpp @@ -9,7 +9,7 @@ class COptMainDlg : public CPluginDlgBase public:
COptMainDlg() :
- CPluginDlgBase(hInst, IDD_MAIN, pluginName),
+ CPluginDlgBase(g_plugin.getInst(), IDD_MAIN, pluginName),
edtCount(this, ID_MAXQUESTCOUNT),
edtDescr(this, ID_DESCRIPTION),
chk1(this, ID_INFTALKPROT),
@@ -44,7 +44,7 @@ class COptMessageDlg : public CPluginDlgBase public:
COptMessageDlg() :
- CPluginDlgBase(hInst, IDD_MESSAGES, pluginName),
+ CPluginDlgBase(g_plugin.getInst(), IDD_MESSAGES, pluginName),
btnHelp(this, IDC_VARS),
btnRestore(this, ID_RESTOREDEFAULTS),
edtQuestion(this, ID_QUESTION),
@@ -94,7 +94,7 @@ class COptAccountDlg : public CPluginDlgBase public:
COptAccountDlg() :
- CPluginDlgBase(hInst, IDD_PROTO, pluginName),
+ CPluginDlgBase(g_plugin.getInst(), IDD_PROTO, pluginName),
m_accounts(this, IDC_PROTO)
{
m_accounts.OnItemChanged = Callback(this, &COptAccountDlg::list_OnItemChanged);
diff --git a/plugins/StopSpamPlus/src/stdafx.h b/plugins/StopSpamPlus/src/stdafx.h index e391c7780f..c92038517c 100644 --- a/plugins/StopSpamPlus/src/stdafx.h +++ b/plugins/StopSpamPlus/src/stdafx.h @@ -9,7 +9,6 @@ #include <sstream>
#include <list>
-#define __NO_CMPLUGIN_NEEDED
#include <newpluginapi.h>
#include <m_database.h>
#include <m_protosvc.h>
@@ -32,9 +31,14 @@ typedef std::wstring tstring; #define pluginName LPGEN("StopSpam")
-extern char const *answeredSetting;
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(pluginName)
+ {}
+};
-extern HINSTANCE hInst;
+extern char const *answeredSetting;
// utils
tstring &GetDlgItemString(HWND hwnd, int id);
diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp index 7352177744..7ea8d973a6 100644 --- a/plugins/StopSpamPlus/src/stopspam.cpp +++ b/plugins/StopSpamPlus/src/stopspam.cpp @@ -1,6 +1,8 @@ #include "stdafx.h"
int hLangpack;
+CMPlugin g_plugin;
+CLIST_INTERFACE *pcli;
/////////////////////////////////////////////////////////////////////////////////////////
// returns plugin's extended information
@@ -18,19 +20,12 @@ PLUGININFOEX pluginInfoEx = { { 0x553811ee, 0xdeb6, 0x48b8, { 0x89, 0x2, 0xa8, 0xa0, 0xc, 0x1f, 0xd6, 0x79 } }
};
-CLIST_INTERFACE *pcli;
-HINSTANCE hInst;
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- hInst = hinstDLL;
- return TRUE;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
extern "C" int __declspec(dllexport) Load(void)
{
@@ -58,6 +53,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
|