summaryrefslogtreecommitdiff
path: root/protocols/Sametime/src/sametime.cpp
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 /protocols/Sametime/src/sametime.cpp
parent524d1c7186eca3f0a4da08548eeb919785227101 (diff)
PLUGIN<> to half-automatically calculate the dll's g_hInstance and pass it inside
Diffstat (limited to 'protocols/Sametime/src/sametime.cpp')
-rw-r--r--protocols/Sametime/src/sametime.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp
index e02d755a40..7e842b1501 100644
--- a/protocols/Sametime/src/sametime.cpp
+++ b/protocols/Sametime/src/sametime.cpp
@@ -17,16 +17,11 @@ PLUGININFOEX pluginInfo =
};
CMPlugin g_plugin;
-HINSTANCE hInst;
+HINSTANCE g_hInstance;
LIST<CSametimeProto> g_Instances(1, PtrKeySortT);
int hLangpack;
-// sametime.cpp: Defines the entry point for the DLL application.
-extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
-{
- hInst = hinstDLL;
- return TRUE;
-}
+extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
@@ -65,7 +60,7 @@ INT_PTR CSametimeProto::SametimeLoadIcon(WPARAM wParam, LPARAM lParam)
return NULL;
}
- return (INT_PTR) LoadImage(hInst, MAKEINTRESOURCE(id), IMAGE_ICON,
+ return (INT_PTR) LoadImage(g_hInstance, MAKEINTRESOURCE(id), IMAGE_ICON,
GetSystemMetrics(wParam & PLIF_SMALL ? SM_CXSMICON : SM_CXICON),
GetSystemMetrics(wParam & PLIF_SMALL ? SM_CYSMICON : SM_CYICON), 0);
}
@@ -84,7 +79,7 @@ static IconItem iconList[] =
void SametimeInitIcons(void)
{
- Icon_Register(hInst, "Protocols/Sametime", iconList, _countof(iconList), "SAMETIME");
+ Icon_Register(g_hInstance, "Protocols/Sametime", iconList, _countof(iconList), "SAMETIME");
}
HANDLE GetIconHandle(int iconId)