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 --- protocols/Dummy/src/main.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'protocols/Dummy/src/main.cpp') diff --git a/protocols/Dummy/src/main.cpp b/protocols/Dummy/src/main.cpp index 6a57644bf3..93492c1df6 100644 --- a/protocols/Dummy/src/main.cpp +++ b/protocols/Dummy/src/main.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . #include "stdafx.h" #include "version.h" -HINSTANCE hInst; +HINSTANCE g_hInstance; int hLangpack; CLIST_INTERFACE *pcli; @@ -36,19 +36,13 @@ PLUGININFOEX pluginInfo = { 0x2a1081d1, 0xaee3, 0x4091, {0xb7, 0xd, 0xae, 0x46, 0xd0, 0x9f, 0x9a, 0x7f}} }; -///////////////////////////////////////////////////////////////////////////////////////// - -BOOL WINAPI DllMain(HINSTANCE hModule, DWORD, LPVOID) -{ - hInst = hModule; - return TRUE; -} - extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD) { return &pluginInfo; } +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST}; ///////////////////////////////////////////////////////////////////////////////////////// @@ -94,3 +88,5 @@ struct CMPlugin : public ACCPROTOPLUGIN } } g_plugin; + +extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain; -- cgit v1.2.3