diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-18 18:14:33 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-18 18:14:33 +0300 |
commit | b172c4bbc75cdad0e8ccd22292aa671ba43cac45 (patch) | |
tree | 4677a04a47f3987c88f3fb44c6b70d2642b1f8a3 /plugins/GmailNotifier/src/main.cpp | |
parent | 524d1c7186eca3f0a4da08548eeb919785227101 (diff) |
PLUGIN<> to half-automatically calculate the dll's g_hInstance and pass it inside
Diffstat (limited to 'plugins/GmailNotifier/src/main.cpp')
-rw-r--r-- | plugins/GmailNotifier/src/main.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp index 9dccc5965d..945ab5984d 100644 --- a/plugins/GmailNotifier/src/main.cpp +++ b/plugins/GmailNotifier/src/main.cpp @@ -11,7 +11,7 @@ There is no warranty. #include "version.h"
CLIST_INTERFACE *pcli;
-HINSTANCE hInst;
+HINSTANCE g_hInstance;
int hLangpack;
UINT hTimer;
HANDLE hMirandaStarted, hOptionsInitial;
@@ -56,12 +56,6 @@ INT_PTR GetName(WPARAM wParam, LPARAM lParam) return 0;
}
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- hInst = hinstDLL;
- return TRUE;
-}
-
void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
{
PluginMenuCommand(0, 0);
@@ -170,12 +164,14 @@ extern "C" int __declspec(dllexport) Unload(void) /////////////////////////////////////////////////////////////////////////////////////////
-struct CMPlugin : public CMPluginBase
+struct CMPlugin : public PLUGIN<CMPlugin>
{
CMPlugin() :
- CMPluginBase(MODULE_NAME)
+ PLUGIN<CMPlugin>(MODULE_NAME)
{
RegisterProtocol(PROTOTYPE_VIRTUAL);
}
}
g_plugin;
+
+extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
|