summaryrefslogtreecommitdiff
path: root/plugins/CrashDumper/src
diff options
context:
space:
mode:
authorMataes <mataes2007@gmail.com>2018-05-16 21:12:31 +0300
committerMataes <mataes2007@gmail.com>2018-05-16 21:12:31 +0300
commit1fc8e65dd319abf0bac6ce753bb87ecbabd8b177 (patch)
tree94aaf74e14515883aea9da6752ccacca6007fa47 /plugins/CrashDumper/src
parentaba882ecf1f570400c301493725fcb31270e0fd5 (diff)
Flags, CrashDumper, CryptoPP, CSList, Db_autobackups, DbEditorPP: cmplugin adaptation
Diffstat (limited to 'plugins/CrashDumper/src')
-rw-r--r--plugins/CrashDumper/src/crshdmp.cpp12
-rw-r--r--plugins/CrashDumper/src/crshdmp_icons.cpp2
-rw-r--r--plugins/CrashDumper/src/stdafx.h10
-rw-r--r--plugins/CrashDumper/src/ui.cpp3
4 files changed, 12 insertions, 15 deletions
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp
index 64d10f56f6..ae4450d937 100644
--- a/plugins/CrashDumper/src/crshdmp.cpp
+++ b/plugins/CrashDumper/src/crshdmp.cpp
@@ -18,9 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
+CMPlugin g_plugin;
int hLangpack;
-HINSTANCE hInst;
DWORD mirandaVersion;
LCID packlcid;
//HANDLE hCrashLogFolder, hVerInfoFolder;
@@ -119,7 +119,7 @@ INT_PTR ViewVersionInfo(WPARAM wParam, LPARAM)
}
else {
DWORD dwFlags = wParam ? (VI_FLAG_PRNVAR | VI_FLAG_PRNDLL) : VI_FLAG_PRNVAR;
- hViewWnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_VIEWVERSION), nullptr, DlgProcView, dwFlags);
+ hViewWnd = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_VIEWVERSION), nullptr, DlgProcView, dwFlags);
}
return 0;
@@ -200,7 +200,7 @@ int OptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
- odp.hInstance = hInst;
+ odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.a = PluginName;
odp.szGroup.a = LPGEN("Services");
@@ -404,9 +404,3 @@ extern "C" int __declspec(dllexport) Unload(void)
FreeLibrary(hMsftedit);
return 0;
}
-
-extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- hInst = hinstDLL;
- return TRUE;
-}
diff --git a/plugins/CrashDumper/src/crshdmp_icons.cpp b/plugins/CrashDumper/src/crshdmp_icons.cpp
index cbefe71020..eec6791409 100644
--- a/plugins/CrashDumper/src/crshdmp_icons.cpp
+++ b/plugins/CrashDumper/src/crshdmp_icons.cpp
@@ -30,7 +30,7 @@ static IconItem iconList[] =
void InitIcons(void)
{
- Icon_Register(hInst, LPGEN("Crash Dumper"), iconList, _countof(iconList), PluginName);
+ Icon_Register(g_plugin.getInst(), LPGEN("Crash Dumper"), iconList, _countof(iconList), PluginName);
}
HICON LoadIconEx(int iconId, bool big)
diff --git a/plugins/CrashDumper/src/stdafx.h b/plugins/CrashDumper/src/stdafx.h
index ff651e6839..ac343409e7 100644
--- a/plugins/CrashDumper/src/stdafx.h
+++ b/plugins/CrashDumper/src/stdafx.h
@@ -25,8 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <delayimp.h>
#include <malloc.h>
-#define __NO_CMPLUGIN_NEEDED
-
#include <newpluginapi.h>
#include <m_utils.h>
#include <m_langpack.h>
@@ -80,6 +78,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PluginName "Crash Dumper"
+struct CMPlugin : public PLUGIN<CMPlugin>
+{
+ CMPlugin() :
+ PLUGIN<CMPlugin>(PluginName)
+ {}
+};
+
#define VI_FLAG_FORMAT 1
#define VI_FLAG_PRNVAR 2
#define VI_FLAG_PRNDLL 4
@@ -91,7 +96,6 @@ struct VerTrnsfr
bool autot;
};
-extern HMODULE hInst;
extern DWORD mirandaVersion;
extern LCID packlcid;
extern bool servicemode, clsdates, dtsubfldr, catchcrashes, needrestart;
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp
index d09ac5b809..d270b7438b 100644
--- a/plugins/CrashDumper/src/ui.cpp
+++ b/plugins/CrashDumper/src/ui.cpp
@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
HWND hViewWnd;
-extern HINSTANCE hInst;
HDWP MyResizeWindow(HDWP hDwp, HWND hwndDlg, HWND hwndCtrl, int nHorizontalOffset, int nVerticalOffset, int nWidthOffset, int nHeightOffset)
{
@@ -132,7 +131,7 @@ INT_PTR CALLBACK DlgProcView(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if (PtInRect(&rc, pt)) {
static const CHARRANGE all = { 0, -1 };
- HMENU hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
+ HMENU hMenu = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_CONTEXT));
HMENU hSubMenu = GetSubMenu(hMenu, 0);
TranslateMenu(hSubMenu);