summaryrefslogtreecommitdiff
path: root/plugins/SimpleAR/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SimpleAR/src')
-rw-r--r--plugins/SimpleAR/src/Main.cpp21
-rw-r--r--plugins/SimpleAR/src/Options.cpp2
-rw-r--r--plugins/SimpleAR/src/stdafx.h12
3 files changed, 22 insertions, 13 deletions
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp
index 5a73931214..2a5c2ffa08 100644
--- a/plugins/SimpleAR/src/Main.cpp
+++ b/plugins/SimpleAR/src/Main.cpp
@@ -16,13 +16,13 @@ Copyright (C) 2000-2 Richard Hughes, Roland Rabien & Tristan Van de Vreede
#include "stdafx.h"
+int hLangpack;
+CMPlugin g_plugin;
CLIST_INTERFACE *pcli;
-HINSTANCE hinstance;
HGENMENU hToggle, hEnableMenu;
BOOL gbVarsServiceExist = FALSE;
INT interval;
-int hLangpack;
wchar_t* ptszDefaultMsg[] = {
LPGENW("I am currently away. I will reply to you when I am back."),
@@ -33,7 +33,10 @@ wchar_t* ptszDefaultMsg[] = {
LPGENW("I am having meal right now. I will get back to you very soon.")
};
-PLUGININFOEX pluginInfoEx = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx =
+{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -51,11 +54,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
return &pluginInfoEx;
}
-BOOL WINAPI DllMain(HINSTANCE hinst, DWORD, LPVOID)
-{
- hinstance = hinst;
- return TRUE;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
INT_PTR ToggleEnable(WPARAM, LPARAM)
{
@@ -237,6 +236,8 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
IconItemT iconList[] =
{
{ LPGENW("Disable Auto&reply"), "Disable Auto&reply", IDI_OFF },
@@ -270,11 +271,13 @@ extern "C" int __declspec(dllexport)Load(void)
HookEvent(ME_DB_EVENT_ADDED, addEvent);
HookEvent(ME_SYSTEM_MODULESLOADED, CheckDefaults);
- Icon_RegisterT(hinstance, L"Simple Auto Replier", iconList, _countof(iconList));
+ Icon_RegisterT(g_plugin.getInst(), L"Simple Auto Replier", iconList, _countof(iconList));
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport)int Unload(void)
{
return 0;
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp
index 7647b89dd5..e1f0f583ef 100644
--- a/plugins/SimpleAR/src/Options.cpp
+++ b/plugins/SimpleAR/src/Options.cpp
@@ -137,7 +137,7 @@ INT OptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = -790000000;
- odp.hInstance = hinstance;
+ odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTION);
odp.szTitle.a = LPGEN("Simple Auto Replier");
odp.szGroup.a = LPGEN("Message sessions");
diff --git a/plugins/SimpleAR/src/stdafx.h b/plugins/SimpleAR/src/stdafx.h
index 26d54bb57a..2ba5c1c970 100644
--- a/plugins/SimpleAR/src/stdafx.h
+++ b/plugins/SimpleAR/src/stdafx.h
@@ -3,7 +3,6 @@
#include <windows.h>
#include <time.h>
-#define __NO_CMPLUGIN_NEEDED
#include <newpluginapi.h>
#include <m_clistint.h>
#include <m_langpack.h>
@@ -23,8 +22,15 @@
#define KEY_HEADING "Heading"
#define KEY_REPEATINTERVAL "RepeatInterval"
-//General
-extern HINSTANCE hinstance;
+// General
+
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(protocolname)
+ {}
+};
+
extern INT interval;
extern wchar_t *ptszDefaultMsg[6];
extern HGENMENU hEnableMenu;