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 /protocols/Dummy/src/main.cpp | |
parent | 524d1c7186eca3f0a4da08548eeb919785227101 (diff) |
PLUGIN<> to half-automatically calculate the dll's g_hInstance and pass it inside
Diffstat (limited to 'protocols/Dummy/src/main.cpp')
-rw-r--r-- | protocols/Dummy/src/main.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
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 <http://www.gnu.org/licenses/>. #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<CDummyProto> }
}
g_plugin;
+
+extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
|