summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-29 11:35:36 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-29 11:35:47 +0300
commita7eef3943d842af99e53d240f321b1467df7ea21 (patch)
tree03866539a106cd8f2a42a52bf929a1b0496d1b3f /protocols
parent3e6fb10c557538bbb89666b1423bf7c85f1e4aff (diff)
CMPlugin doesn't work in ICQCorp because of the clutch with dll name
Diffstat (limited to 'protocols')
-rw-r--r--protocols/ICQCorp/src/corp.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/protocols/ICQCorp/src/corp.cpp b/protocols/ICQCorp/src/corp.cpp
index 2ea3819966..de702c3217 100644
--- a/protocols/ICQCorp/src/corp.cpp
+++ b/protocols/ICQCorp/src/corp.cpp
@@ -37,13 +37,34 @@ PLUGININFOEX pluginInfo =
UNICODE_AWARE
};
+//////////////////////////////////////////////////////////////////////////
+// Interface information
+
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
+
///////////////////////////////////////////////////////////////////////////////
BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD reason, LPVOID)
{
hInstance = hModule;
- if (reason == DLL_PROCESS_ATTACH)
+ if (reason == DLL_PROCESS_ATTACH) {
+ char fileName[MAX_PATH];
+ GetModuleFileNameA(hInstance, fileName, MAX_PATH);
+
+ WIN32_FIND_DATAA findData;
+ FindClose(FindFirstFileA(fileName, &findData));
+ findData.cFileName[strlen(findData.cFileName) - 4] = 0;
+ strncpy_s(protoName, findData.cFileName, _TRUNCATE);
+
+ PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
+ pd.szName = protoName;
+ pd.type = PROTOTYPE_PROTOCOL;
+ Proto_RegisterModule(&pd);
+
+ Proto_SetUniqueId(protoName, "UIN");
+
DisableThreadLibraryCalls(hModule);
+ }
return TRUE;
}
@@ -72,27 +93,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
return &pluginInfo;
}
-/////////////////////////////////////////////////////////////////////////////////////////
-
-struct CMPlugin : public CMPluginBase
-{
- CMPlugin() :
- CMPluginBase(protoName)
- {
- char fileName[MAX_PATH];
- GetModuleFileNameA(hInstance, fileName, MAX_PATH);
-
- WIN32_FIND_DATAA findData;
- FindClose(FindFirstFileA(fileName, &findData));
- findData.cFileName[strlen(findData.cFileName) - 4] = 0;
- strncpy_s(protoName, findData.cFileName, _TRUNCATE);
-
- RegisterProtocol(PROTOTYPE_PROTOCOL);
- SetUniqueId("UIN");
- }
-}
- g_plugin;
-
///////////////////////////////////////////////////////////////////////////////
#ifdef _DEBUG