summaryrefslogtreecommitdiff
path: root/plugins/YAMN/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 /plugins/YAMN/src/main.cpp
parent3936ebbc665c9653d9f62527c1e136944d52e2ca (diff)
g_hInstance incapulated into PLUGIN<>, no need in the separate variable
Diffstat (limited to 'plugins/YAMN/src/main.cpp')
-rw-r--r--plugins/YAMN/src/main.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp
index 7491051500..53ff5dbf6a 100644
--- a/plugins/YAMN/src/main.cpp
+++ b/plugins/YAMN/src/main.cpp
@@ -23,7 +23,6 @@ int YAMN_STATUS;
BOOL UninstallPlugins;
HANDLE hAccountFolder;
-HINSTANCE g_hInstance;
HINSTANCE *hDllPlugins;
static int iDllPlugins = 0;
@@ -70,6 +69,12 @@ static void GetProfileDirectory(wchar_t *szPath, int cbPath)
/////////////////////////////////////////////////////////////////////////////////////////
+CMPlugin g_plugin;
+
+extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
/////////////////////////////////////////////////////////////////////////////////////////
@@ -163,7 +168,7 @@ static IconItem iconList[] =
void LoadIcons()
{
- Icon_Register(g_hInstance, "YAMN", iconList, _countof(iconList));
+ Icon_Register(g_plugin.getInst(), "YAMN", iconList, _countof(iconList));
}
HANDLE WINAPI g_GetIconHandle(int idx)
@@ -354,18 +359,3 @@ extern "C" int __declspec(dllexport) Unload(void)
delete[] CodePageNamesSupp;
return 0;
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-struct CMPlugin : public PLUGIN<CMPlugin>
-{
- CMPlugin() :
- PLUGIN<CMPlugin>(YAMN_DBMODULE)
- {
- RegisterProtocol(PROTOTYPE_VIRTUAL);
- SetUniqueId("Id");
- }
-}
- g_plugin;
-
-extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;