diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-18 20:51:18 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-18 20:51:18 +0300 |
commit | 9cf1444eb7888f2d942d220f938aa893396a8a1b (patch) | |
tree | ea87e4cb78e9c26a651af00b2d423324ce4a85a6 /protocols/Tox/src/main.cpp | |
parent | 3936ebbc665c9653d9f62527c1e136944d52e2ca (diff) |
g_hInstance incapulated into PLUGIN<>, no need in the separate variable
Diffstat (limited to 'protocols/Tox/src/main.cpp')
-rw-r--r-- | protocols/Tox/src/main.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/protocols/Tox/src/main.cpp b/protocols/Tox/src/main.cpp index ec6ae99f82..1b4c10f526 100644 --- a/protocols/Tox/src/main.cpp +++ b/protocols/Tox/src/main.cpp @@ -1,10 +1,8 @@ #include "stdafx.h" int hLangpack; -CMPlugin g_plugin; CHAT_MANAGER *pci; CLIST_INTERFACE *pcli; -HINSTANCE g_hInstance; HANDLE hProfileFolderPath; PLUGININFOEX pluginInfo = @@ -21,15 +19,23 @@ PLUGININFOEX pluginInfo = {0x272a3e, 0xf5fa, 0x4090, {0x8b, 0x67, 0x3e, 0x62, 0xac, 0x1e, 0xe0, 0xb4}} }; -extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain; - extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfo; } +///////////////////////////////////////////////////////////////////////////////////////// + +CMPlugin g_plugin; + +extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain; + +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; +///////////////////////////////////////////////////////////////////////////////////////// + int OnModulesLoaded(WPARAM, LPARAM) { CToxProto::InitIcons(); @@ -38,7 +44,7 @@ int OnModulesLoaded(WPARAM, LPARAM) if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) { CreateServiceFunction(MODULE "/ParseUri", CToxProto::ParseToxUri); - AssocMgr_AddNewUrlTypeW("tox:", TranslateT("Tox link protocol"), g_hInstance, IDI_TOX, MODULE "/ParseUri", 0); + AssocMgr_AddNewUrlTypeW("tox:", TranslateT("Tox link protocol"), g_plugin.getInst(), IDI_TOX, MODULE "/ParseUri", 0); } return 0; @@ -55,6 +61,8 @@ extern "C" int __declspec(dllexport) Load(void) return 0; } +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" int __declspec(dllexport) Unload(void) { return 0; |