summaryrefslogtreecommitdiff
path: root/plugins/Folders/src
diff options
context:
space:
mode:
authorMataes <mataes2007@gmail.com>2018-05-16 21:48:52 +0300
committerMataes <mataes2007@gmail.com>2018-05-16 21:49:13 +0300
commit650fc5a2103cedfe149500ade9c684ecf381d348 (patch)
treea7f4727baa7b298992a65d240a6017dda3a82f9a /plugins/Folders/src
parentf1195d51ea8094492fcf63a301f2cdc9d1173d6c (diff)
FavContacts, FileAsMessage, Fingerprint, FloatingContacts, Folders, FTPFile: cmplugin adaptation
Diffstat (limited to 'plugins/Folders/src')
-rw-r--r--plugins/Folders/src/dlg_handlers.cpp4
-rw-r--r--plugins/Folders/src/folders.cpp9
-rw-r--r--plugins/Folders/src/stdafx.h13
3 files changed, 12 insertions, 14 deletions
diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp
index 1135235741..45b38585f4 100644
--- a/plugins/Folders/src/dlg_handlers.cpp
+++ b/plugins/Folders/src/dlg_handlers.cpp
@@ -194,7 +194,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
break;
case IDC_HELP_BUTTON:
- ShowWindow(CreateDialog(hInstance, MAKEINTRESOURCE(IDD_VARIABLES_HELP), hWnd, DlgProcVariables), SW_SHOW);
+ ShowWindow(CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_VARIABLES_HELP), hWnd, DlgProcVariables), SW_SHOW);
break;
case IDC_FOLDERS_SECTIONS_LIST:
@@ -247,7 +247,7 @@ static int OnOptionsInitialize(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
- odp.hInstance = hInstance;
+ odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FOLDERS);
odp.szTitle.a = LPGEN("Folders");
odp.szGroup.a = LPGEN("Customize");
diff --git a/plugins/Folders/src/folders.cpp b/plugins/Folders/src/folders.cpp
index e31e048b24..20f9f17050 100644
--- a/plugins/Folders/src/folders.cpp
+++ b/plugins/Folders/src/folders.cpp
@@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-char ModuleName[] = "Folders";
-HINSTANCE hInstance;
+CMPlugin g_plugin;
int hLangpack;
OBJLIST<CFolderItem> lstRegisteredFolders(10, PtrKeySortT);
@@ -59,9 +58,3 @@ extern "C" __declspec(dllexport) int Unload()
DestroyEvents();
return 0;
}
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- hInstance = hinstDLL;
- return TRUE;
-}
diff --git a/plugins/Folders/src/stdafx.h b/plugins/Folders/src/stdafx.h
index 17b917a9f7..e78ab16a32 100644
--- a/plugins/Folders/src/stdafx.h
+++ b/plugins/Folders/src/stdafx.h
@@ -30,8 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <string.h>
#include <malloc.h>
-#define __NO_CMPLUGIN_NEEDED
-
#include <newpluginapi.h>
#include <m_database.h>
#include <m_system.h>
@@ -56,8 +54,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_FOLDERS_TEST_PLUGIN "Folders/Test/Plugin"
-extern char ModuleName[];
-extern HINSTANCE hInstance;
+#define ModuleName "Folders"
+
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(ModuleName)
+ {}
+};
+
extern OBJLIST<CFolderItem> lstRegisteredFolders;
#endif //FOLDERS_COMMONHEADERS_H \ No newline at end of file