diff options
Diffstat (limited to 'plugins/ProfileManager/src/pmanagerEx.cpp')
-rw-r--r-- | plugins/ProfileManager/src/pmanagerEx.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index fad24aae35..4cfbce533e 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -13,10 +13,20 @@ There is no warranty. #define SRV_CHANGE_PM "Database/ChangePM"
#define SRV_RESTART_ME "System/RestartMe"
-HINSTANCE hInst;
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(nullptr)
+ {}
+}
+g_plugin;
+
int hLangpack;
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfo =
+{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -36,14 +46,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) /////////////////////////////////////////////////////////////////////////////////////////
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- hInst = hinstDLL;
- return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
static INT_PTR ChangePM(WPARAM, LPARAM)
{
wchar_t fn[MAX_PATH];
@@ -85,7 +87,7 @@ extern "C" __declspec(dllexport) int Load(void) {
mir_getLP(&pluginInfo);
- Icon_Register(hInst, LPGEN("Profile manager"), iconList, _countof(iconList));
+ Icon_Register(g_plugin.getInst(), LPGEN("Profile manager"), iconList, _countof(iconList));
CreateServiceFunction(SRV_LOAD_PM, LoadPM);
CreateServiceFunction(SRV_CHANGE_PM, ChangePM);
@@ -107,6 +109,8 @@ extern "C" __declspec(dllexport) int Load(void) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Unload(void)
{
return 0;
|