summaryrefslogtreecommitdiff
path: root/include
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 /include
parent3936ebbc665c9653d9f62527c1e136944d52e2ca (diff)
g_hInstance incapulated into PLUGIN<>, no need in the separate variable
Diffstat (limited to 'include')
-rw-r--r--include/m_plugin.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/m_plugin.h b/include/m_plugin.h
index ae56eeb49a..340b3100fe 100644
--- a/include/m_plugin.h
+++ b/include/m_plugin.h
@@ -4,8 +4,6 @@
#include <m_database.h>
#include <m_protocols.h>
-extern HINSTANCE g_hInstance;
-
class MIR_APP_EXPORT CMPluginBase
{
void tryOpenLog();
@@ -15,7 +13,7 @@ protected:
HANDLE m_hLogger = nullptr;
HINSTANCE m_hInst;
- CMPluginBase(HINSTANCE, const char *moduleName);
+ CMPluginBase(const char *moduleName);
~CMPluginBase();
// pass one of PROTOTYPE_* constants as type
@@ -30,6 +28,7 @@ public:
void debugLogW(LPCWSTR wszFormat, ...);
__forceinline HINSTANCE getInst() const { return m_hInst; }
+ __forceinline void setInst(HINSTANCE hInst) { m_hInst = hInst; }
__forceinline INT_PTR delSetting(const char *name)
{
@@ -172,13 +171,13 @@ template<class T> class PLUGIN : public CMPluginBase
public:
static BOOL WINAPI RawDllMain(HINSTANCE hInstance, DWORD, LPVOID)
{
- g_hInstance = hInstance;
+ g_plugin.setInst(hInstance);
return TRUE;
}
protected:
PLUGIN(const char *moduleName)
- : CSuper(g_hInstance, moduleName)
+ : CSuper(moduleName)
{}
__forceinline HANDLE CreatePluginEvent(const char *name)