summaryrefslogtreecommitdiff
path: root/plugins/Quotes
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-18 18:14:33 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-18 18:14:33 +0300
commitb172c4bbc75cdad0e8ccd22292aa671ba43cac45 (patch)
tree4677a04a47f3987c88f3fb44c6b70d2642b1f8a3 /plugins/Quotes
parent524d1c7186eca3f0a4da08548eeb919785227101 (diff)
PLUGIN<> to half-automatically calculate the dll's g_hInstance and pass it inside
Diffstat (limited to 'plugins/Quotes')
-rw-r--r--plugins/Quotes/src/Forex.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp
index 55c5e6379b..c1f6625f62 100644
--- a/plugins/Quotes/src/Forex.cpp
+++ b/plugins/Quotes/src/Forex.cpp
@@ -290,12 +290,6 @@ inline int Quotes_UnhookEvent(HANDLE h)
return UnhookEvent(h);
}
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- g_hInstance = hinstDLL;
- return TRUE;
-}
-
EXTERN_C __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
EXTERN_C __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
@@ -338,13 +332,15 @@ EXTERN_C __declspec(dllexport) int Unload(void)
/////////////////////////////////////////////////////////////////////////////////////////
-struct CMPlugin : public CMPluginBase
+struct CMPlugin : public PLUGIN<CMPlugin>
{
CMPlugin() :
- CMPluginBase(QUOTES_PROTOCOL_NAME)
+ PLUGIN<CMPlugin>(QUOTES_PROTOCOL_NAME)
{
RegisterProtocol(PROTOTYPE_VIRTUAL);
SetUniqueId(DB_STR_QUOTE_SYMBOL);
}
}
g_plugin;
+
+extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;