diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-28 14:29:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-28 14:29:31 +0300 |
commit | a905c9c3f92fd54f37a5466649ac378db69e7cb0 (patch) | |
tree | 87a60dadfbf9fd8d916ea9100c26b6e314293242 /protocols/ICQCorp | |
parent | d75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff) |
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/ICQCorp')
-rw-r--r-- | protocols/ICQCorp/src/corp.cpp | 33 | ||||
-rw-r--r-- | protocols/ICQCorp/src/stdafx.h | 1 |
2 files changed, 21 insertions, 13 deletions
diff --git a/protocols/ICQCorp/src/corp.cpp b/protocols/ICQCorp/src/corp.cpp index 2687a3e9fc..4eabd5862c 100644 --- a/protocols/ICQCorp/src/corp.cpp +++ b/protocols/ICQCorp/src/corp.cpp @@ -61,19 +61,6 @@ extern "C" __declspec(dllexport) int Load() {
mir_getLP(&pluginInfo);
- 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);
-
LoadServices();
return 0;
}
@@ -85,6 +72,26 @@ 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);
+ }
+}
+ g_plugin;
+
///////////////////////////////////////////////////////////////////////////////
#ifdef _DEBUG
diff --git a/protocols/ICQCorp/src/stdafx.h b/protocols/ICQCorp/src/stdafx.h index 5aac37d71e..536858d2f6 100644 --- a/protocols/ICQCorp/src/stdafx.h +++ b/protocols/ICQCorp/src/stdafx.h @@ -37,6 +37,7 @@ #include <m_clist.h> #include <m_userinfo.h> #include <m_timezones.h> +#include <m_plugin.h> #include "user.h" #include "transfer.h" |