summaryrefslogtreecommitdiff
path: root/protocols/ICQCorp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
commit8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch)
tree03e5b4870f09a3163306740c2eebee47bc15b042 /protocols/ICQCorp
parentc5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff)
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'protocols/ICQCorp')
-rw-r--r--protocols/ICQCorp/src/corp.cpp21
-rw-r--r--protocols/ICQCorp/src/stdafx.h15
2 files changed, 19 insertions, 17 deletions
diff --git a/protocols/ICQCorp/src/corp.cpp b/protocols/ICQCorp/src/corp.cpp
index e71c55b57b..fb3559bedb 100644
--- a/protocols/ICQCorp/src/corp.cpp
+++ b/protocols/ICQCorp/src/corp.cpp
@@ -26,7 +26,7 @@ char protoName[64];
CMPlugin g_plugin;
HNETLIBUSER hNetlibUser;
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -38,9 +38,24 @@ PLUGININFOEX pluginInfo =
UNICODE_AWARE
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(protoName, pluginInfoEx)
+{
+ char fileName[MAX_PATH];
+ GetModuleFileNameA(m_hInst, fileName, MAX_PATH);
+
+ WIN32_FIND_DATAA findData;
+ FindClose(FindFirstFileA(fileName, &findData));
+ findData.cFileName[strlen(findData.cFileName) - 4] = 0;
+ strncpy_s(protoName, findData.cFileName, _TRUNCATE);
+
+ Proto_RegisterModule(PROTOTYPE_PROTOCOL, protoName);
+ Proto_SetUniqueId(protoName, "UIN");
+}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
//////////////////////////////////////////////////////////////////////////
@@ -52,7 +67,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
extern "C" __declspec(dllexport) int Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
CMStringA szDescr(FORMAT, "%s connection", protoName);
NETLIBUSER nlu = {};
diff --git a/protocols/ICQCorp/src/stdafx.h b/protocols/ICQCorp/src/stdafx.h
index d31ba24953..215bb0a9dc 100644
--- a/protocols/ICQCorp/src/stdafx.h
+++ b/protocols/ICQCorp/src/stdafx.h
@@ -59,18 +59,5 @@ extern int UnloadServices();
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(protoName)
- {
- char fileName[MAX_PATH];
- GetModuleFileNameA(m_hInst, fileName, MAX_PATH);
-
- WIN32_FIND_DATAA findData;
- FindClose(FindFirstFileA(fileName, &findData));
- findData.cFileName[strlen(findData.cFileName) - 4] = 0;
- strncpy_s(protoName, findData.cFileName, _TRUNCATE);
-
- Proto_RegisterModule(PROTOTYPE_PROTOCOL, protoName);
- Proto_SetUniqueId(protoName, "UIN");
- }
+ CMPlugin();
};