From b172c4bbc75cdad0e8ccd22292aa671ba43cac45 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 18 Apr 2018 18:14:33 +0300 Subject: PLUGIN<> to half-automatically calculate the dll's g_hInstance and pass it inside --- plugins/Quotes/src/Forex.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'plugins/Quotes/src') 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() : - CMPluginBase(QUOTES_PROTOCOL_NAME) + PLUGIN(QUOTES_PROTOCOL_NAME) { RegisterProtocol(PROTOTYPE_VIRTUAL); SetUniqueId(DB_STR_QUOTE_SYMBOL); } } g_plugin; + +extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain; -- cgit v1.2.3