summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-18 20:51:18 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-18 20:51:18 +0300
commit9cf1444eb7888f2d942d220f938aa893396a8a1b (patch)
treeea87e4cb78e9c26a651af00b2d423324ce4a85a6 /protocols/Discord/src/main.cpp
parent3936ebbc665c9653d9f62527c1e136944d52e2ca (diff)
g_hInstance incapulated into PLUGIN<>, no need in the separate variable
Diffstat (limited to 'protocols/Discord/src/main.cpp')
-rw-r--r--protocols/Discord/src/main.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/protocols/Discord/src/main.cpp b/protocols/Discord/src/main.cpp
index 3b50bc946b..c0c06bb5cc 100644
--- a/protocols/Discord/src/main.cpp
+++ b/protocols/Discord/src/main.cpp
@@ -17,20 +17,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-CMPlugin g_plugin;
CHAT_MANAGER *pci;
-HINSTANCE g_hInstance;
int hLangpack = 0;
HWND g_hwndHeartbeat;
-extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
-
-IconItem g_iconList[] =
-{
- { LPGEN("Main icon"), "main", IDI_MAIN },
- { LPGEN("Group chats"), "groupchat", IDI_GROUPCHAT }
-};
-
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -44,12 +34,18 @@ PLUGININFOEX pluginInfo = {
{ 0x88928401, 0x2ce8, 0x4568, { 0xaa, 0xa7, 0x22, 0x61, 0x41, 0x87, 0x0c, 0xbf } }
};
- extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
/////////////////////////////////////////////////////////////////////////////////////////
+
+CMPlugin g_plugin;
+
+extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
+
+/////////////////////////////////////////////////////////////////////////////////////////
// Interface information
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
@@ -57,6 +53,12 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
/////////////////////////////////////////////////////////////////////////////////////////
// Load
+IconItem g_iconList[] =
+{
+ { LPGEN("Main icon"), "main", IDI_MAIN },
+ { LPGEN("Group chats"), "groupchat", IDI_GROUPCHAT }
+};
+
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
@@ -64,7 +66,7 @@ extern "C" int __declspec(dllexport) Load(void)
g_hwndHeartbeat = CreateWindowEx(0, L"STATIC", nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr);
- Icon_Register(g_hInstance, "Discord", g_iconList, _countof(g_iconList));
+ Icon_Register(g_plugin.getInst(), "Discord", g_iconList, _countof(g_iconList));
return 0;
}