diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-20 15:08:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-20 15:08:48 +0300 |
commit | 8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch) | |
tree | 03e5b4870f09a3163306740c2eebee47bc15b042 /plugins/MirLua/src/main.cpp | |
parent | c5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff) |
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins/MirLua/src/main.cpp')
-rw-r--r-- | plugins/MirLua/src/main.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp index 6388952bae..73c3d91aa1 100644 --- a/plugins/MirLua/src/main.cpp +++ b/plugins/MirLua/src/main.cpp @@ -12,7 +12,7 @@ HNETLIBUSER hNetlib = nullptr; /////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -27,9 +27,13 @@ PLUGININFOEX pluginInfo = };
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -49,8 +53,8 @@ int OnOptionsInit(WPARAM wParam, LPARAM) int OnModulesLoaded(WPARAM, LPARAM)
{
- g_hCLibsFolder = FoldersRegisterCustomPathT(MODULE, "CLibsFolder", MIRLUA_PATHT, TranslateT("C libs folder"));
- g_hScriptsFolder = FoldersRegisterCustomPathT(MODULE, "ScriptsFolder", MIRLUA_PATHT, TranslateT("Scripts folder"));
+ g_hCLibsFolder = FoldersRegisterCustomPathT(MODULENAME, "CLibsFolder", MIRLUA_PATHT, TranslateT("C libs folder"));
+ g_hScriptsFolder = FoldersRegisterCustomPathT(MODULENAME, "ScriptsFolder", MIRLUA_PATHT, TranslateT("Scripts folder"));
HookEvent(ME_OPT_INITIALISE, OnOptionsInit);
return 0;
@@ -58,20 +62,20 @@ int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
InitIcons();
NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
- nlu.szDescriptiveName.a = MODULE;
- nlu.szSettingsModule = MODULE;
+ nlu.szDescriptiveName.a = MODULENAME;
+ nlu.szSettingsModule = MODULENAME;
hNetlib = Netlib_RegisterUser(&nlu);
- Proto_RegisterModule(PROTOTYPE_FILTER, MODULE);
+ Proto_RegisterModule(PROTOTYPE_FILTER, MODULENAME);
- hRecvMessage = CreateHookableEvent(MODULE PSR_MESSAGE);
- CreateProtoServiceFunction(MODULE, PSR_MESSAGE, FilterRecvMessage);
+ hRecvMessage = CreateHookableEvent(MODULENAME PSR_MESSAGE);
+ CreateProtoServiceFunction(MODULENAME, PSR_MESSAGE, FilterRecvMessage);
g_mLua = new CMLua();
g_mLua->Load();
|