From 650fc5a2103cedfe149500ade9c684ecf381d348 Mon Sep 17 00:00:00 2001 From: Mataes Date: Wed, 16 May 2018 21:48:52 +0300 Subject: FavContacts, FileAsMessage, Fingerprint, FloatingContacts, Folders, FTPFile: cmplugin adaptation --- plugins/Folders/src/dlg_handlers.cpp | 4 ++-- plugins/Folders/src/folders.cpp | 9 +-------- plugins/Folders/src/stdafx.h | 13 +++++++++---- 3 files changed, 12 insertions(+), 14 deletions(-) (limited to 'plugins/Folders') 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 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 #include -#define __NO_CMPLUGIN_NEEDED - #include #include #include @@ -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() : + PLUGIN(ModuleName) + {} +}; + extern OBJLIST lstRegisteredFolders; #endif //FOLDERS_COMMONHEADERS_H \ No newline at end of file -- cgit v1.2.3