From 1367e7c22f39bc3edadd92c99e0142ab5b1357a4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 15 Feb 2019 18:45:14 +0300 Subject: fix for proper MRA registration --- protocols/ICQ-WIM/src/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'protocols/ICQ-WIM/src/main.cpp') diff --git a/protocols/ICQ-WIM/src/main.cpp b/protocols/ICQ-WIM/src/main.cpp index cd55059b6c..cd1ee70f46 100644 --- a/protocols/ICQ-WIM/src/main.cpp +++ b/protocols/ICQ-WIM/src/main.cpp @@ -54,6 +54,12 @@ struct CMPluginMra : public ACCPROTOPLUGIN { SetUniqueId(DB_KEY_ID); } + + void Register() + { + m_hInst = g_plugin.getInst(); + RegisterProtocol(PROTOTYPE_PROTOCOL, g_plugin.fnInit, g_plugin.fnUninit); + } } static g_pluginMra; @@ -62,7 +68,6 @@ static g_pluginMra; CMPlugin::CMPlugin() : ACCPROTOPLUGIN(MODULENAME, pluginInfoEx) { - g_pluginMra.setInst(m_hInst); SetUniqueId(DB_KEY_ID); } @@ -128,6 +133,9 @@ static int OnModulesLoaded(WPARAM, LPARAM) int CMPlugin::Load() { + // register the second instance of this plugin as MRA + g_pluginMra.Register(); + g_hwndHeartbeat = CreateWindowEx(0, L"STATIC", nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr); registerIcon("Protocols/ICQ", iconList, "ICQ"); @@ -136,7 +144,7 @@ int CMPlugin::Load() HookEvent(ME_SYSTEM_MODULEUNLOAD, ModuleLoad); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); return 0; -}; +} int CMPlugin::Unload() { -- cgit v1.2.3