diff options
-rw-r--r-- | plugins/HistoryLinkListPlus/linklist.cpp | 91 | ||||
-rw-r--r-- | plugins/HistoryLinkListPlus/linklist.h | 24 | ||||
-rw-r--r-- | plugins/HistoryLinkListPlus/linklist.vcxproj | 8 | ||||
-rw-r--r-- | plugins/HistoryLinkListPlus/linklist.vcxproj.filters | 8 | ||||
-rw-r--r-- | plugins/HistoryLinkListPlus/linklist_fct.h | 4 |
5 files changed, 53 insertions, 82 deletions
diff --git a/plugins/HistoryLinkListPlus/linklist.cpp b/plugins/HistoryLinkListPlus/linklist.cpp index 56c4c2caaf..053b80d200 100644 --- a/plugins/HistoryLinkListPlus/linklist.cpp +++ b/plugins/HistoryLinkListPlus/linklist.cpp @@ -15,30 +15,7 @@ // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#include <windows.h>
-#include "resource.h"
-#ifdef _DEBUG
-#include <crtdbg.h>
-#endif
-
-// Miranda SDK Includes
-#pragma warning(disable:4996)
-#pragma warning(disable:4100)
-#include <newpluginapi.h>
-#include <m_clist.h>
-#include <m_database.h>
-#include <m_utils.h>
-#include <m_langpack.h>
-#include <m_options.h>
-#pragma warning(default:4100)
-#pragma warning(default:4996)
-
-#include "linklist_dlg.h"
-#include "linklist_fct.h"
#include "linklist.h"
-#include "language.h"
-
-#define MIID_LINKLIST { 0xc9c94733, 0xa054, 0x42b9, { 0x89, 0xcb, 0xb9, 0x71, 0x27, 0xa7, 0xa3, 0x43 } }
// Global variables
HINSTANCE hInst;
@@ -47,12 +24,13 @@ PLUGINLINK *pluginLink; HANDLE hWindowList;
HCURSOR splitCursor;
int hLangpack;
+struct MM_INTERFACE mmi;
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
"History Linklist Plus",
PLUGIN_MAKE_VERSION(0,0,0,2),
- "Generates a list of extracted URIs from the history",
+ "Generates a list of extracted URIs from the history.",
"Thomas Wendel, gureedo",
"gureedo@gmail.com",
"© 2010-2011 gureedo",
@@ -62,56 +40,37 @@ PLUGININFOEX pluginInfo = { { 0xDA0B09F5, 0x9C66, 0x488C, { 0xAE, 0x37, 0x8A, 0x5F, 0x19, 0x1C, 0x90, 0x79 } } // {DA0B09F5-9C66-488C-AE37-8A5F191C9079}
};
-static const MUUID interfaces[] = {MIID_LINKLIST, MIID_LAST};
-struct MM_INTERFACE mmi;
-
-// Functions
-
-__declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
- UNREFERENCED_PARAMETER(lpvReserved);
-
hInst = hinstDLL;
- // Load Rich Edit control
- if ( fdwReason == DLL_PROCESS_ATTACH || fdwReason == DLL_THREAD_ATTACH )
- {
- hRichEdit = LoadLibrary(_T("RICHED32.DLL"));
- if ( !hRichEdit )
- {
- // If Rich Edit DLL load fails, exit
- MessageBox(NULL, _T("Unable to load the Rich Edit control!"), _T("Error"), MB_OK | MB_ICONEXCLAMATION);
- return FALSE;
- }
-
-#ifdef DEBUG
- {
- int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
- flag |= _CRTDBG_LEAK_CHECK_DF|_CRTDBG_CHECK_ALWAYS_DF;
- _CrtSetDbgFlag(flag);
- }
-#endif
-
- DisableThreadLibraryCalls(hinstDLL);
- }
- if ( fdwReason == DLL_PROCESS_DETACH || fdwReason == DLL_THREAD_DETACH ) {
- FreeLibrary(hRichEdit);
- }
-
return TRUE;
}
-int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
{
CLISTMENUITEM linklistmenuitem;
WNDCLASS wndclass;
pluginLink = link;
mir_getLP(&pluginInfo);
+ // Load Rich Edit control
+ hRichEdit = LoadLibrary(_T("RICHED32.DLL"));
+ if (!hRichEdit)
+ {
+ // If Rich Edit DLL load fails, exit
+ MessageBox(NULL, _T("Unable to load the Rich Edit control!"), _T("Error"), MB_OK | MB_ICONEXCLAMATION);
+ FreeLibrary(hRichEdit);
+ return 1;
+ }
+
+#ifdef DEBUG
+ {
+ int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
+ flag |= _CRTDBG_LEAK_CHECK_DF|_CRTDBG_CHECK_ALWAYS_DF;
+ _CrtSetDbgFlag(flag);
+ }
+#endif
+
CreateServiceFunction("Linklist/MenuCommand", LinkList_Main);
ZeroMemory(&linklistmenuitem, sizeof(linklistmenuitem));
linklistmenuitem.cbSize = sizeof(linklistmenuitem);
@@ -145,14 +104,12 @@ int __declspec(dllexport) Load(PLUGINLINK *link) return 0;
}
-__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
- UNREFERENCED_PARAMETER(mirandaVersion);
-
return &pluginInfo;
}
-int __declspec(dllexport) Unload(void)
+extern "C" __declspec(dllexport) int Unload(void)
{
UnhookEvent(ME_DB_EVENT_ADDED);
DestroyCursor(splitCursor);
@@ -171,7 +128,7 @@ int InitOptionsDlg(WPARAM wParam, LPARAM lParam) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_DLG);
odp.pfnDlgProc = OptionsDlgProc;
odp.flags = ODPF_BOLDGROUPS;
- Options_AddPage(wParam, (LPARAM)&odp);
+ Options_AddPage(wParam, &odp);
return 0;
}
diff --git a/plugins/HistoryLinkListPlus/linklist.h b/plugins/HistoryLinkListPlus/linklist.h index 4d56733a7d..17cc63e9c9 100644 --- a/plugins/HistoryLinkListPlus/linklist.h +++ b/plugins/HistoryLinkListPlus/linklist.h @@ -20,8 +20,25 @@ #ifndef _LINKLIST_H
#define _LINKLIST_H
+#define _CRT_SECURE_NO_WARNINGS
+#include <windows.h>
+#ifdef _DEBUG
+#include <crtdbg.h>
+#endif
#include <richedit.h>
+// Miranda SDK Includes
+#include <newpluginapi.h>
+#include <m_clist.h>
+#include <m_database.h>
+#include <m_utils.h>
+#include <m_langpack.h>
+#include <m_options.h>
+
+#include "resource.h"
+#include "linklist_dlg.h"
+#include "language.h"
+
// Filter Flags
#define WLL_URL 0x01
#define WLL_MAIL 0x02
@@ -129,10 +146,11 @@ typedef struct{ BYTE showType;
}LISTOPTIONS;
-BOOL WINAPI DllMain(HINSTANCE ,DWORD ,LPVOID );
-int __declspec(dllexport) Load(PLUGINLINK*);
-int __declspec(dllexport) Unload(void);
static INT_PTR LinkList_Main(WPARAM, LPARAM);
int InitOptionsDlg(WPARAM, LPARAM);
+int DBUpdate(WPARAM, LPARAM);
+int ExtractURI(DBEVENTINFO*, HANDLE, LISTELEMENT*);
+int RemoveList(LISTELEMENT*);
+int ListCount(LISTELEMENT*);
#endif //_LINKLIST_H
\ No newline at end of file diff --git a/plugins/HistoryLinkListPlus/linklist.vcxproj b/plugins/HistoryLinkListPlus/linklist.vcxproj index ddf7701a56..fa7a1a5492 100644 --- a/plugins/HistoryLinkListPlus/linklist.vcxproj +++ b/plugins/HistoryLinkListPlus/linklist.vcxproj @@ -176,10 +176,10 @@ </Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="linklist.c" />
- <ClCompile Include="linklist_dlg.c" />
- <ClCompile Include="linklist_fct.c" />
- <ClCompile Include="utils.c" />
+ <ClCompile Include="linklist.cpp" />
+ <ClCompile Include="linklist_dlg.cpp" />
+ <ClCompile Include="linklist_fct.cpp" />
+ <ClCompile Include="utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="language.h" />
diff --git a/plugins/HistoryLinkListPlus/linklist.vcxproj.filters b/plugins/HistoryLinkListPlus/linklist.vcxproj.filters index 9e8698f21a..e71bcb3719 100644 --- a/plugins/HistoryLinkListPlus/linklist.vcxproj.filters +++ b/plugins/HistoryLinkListPlus/linklist.vcxproj.filters @@ -15,16 +15,16 @@ </Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="linklist.c">
+ <ClCompile Include="linklist.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="linklist_dlg.c">
+ <ClCompile Include="linklist_dlg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="utils.c">
+ <ClCompile Include="utils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="linklist_fct.c">
+ <ClCompile Include="linklist_fct.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
diff --git a/plugins/HistoryLinkListPlus/linklist_fct.h b/plugins/HistoryLinkListPlus/linklist_fct.h index 1a9b191b29..b29c8f82db 100644 --- a/plugins/HistoryLinkListPlus/linklist_fct.h +++ b/plugins/HistoryLinkListPlus/linklist_fct.h @@ -22,9 +22,6 @@ #include "linklist.h"
-int ExtractURI(DBEVENTINFO*, HANDLE, LISTELEMENT*);
-int RemoveList(LISTELEMENT*);
-int ListCount(LISTELEMENT*);
void DrawLine(HWND, size_t);
BYTE GetFlags(HMENU);
void GetFilterText(HMENU, LPTSTR, size_t);
@@ -41,7 +38,6 @@ void GetDBColour(MYCOLOURSET*); void SetDBColour(MYCOLOURSET*);
int GetMirandaColour(MYCOLOURSET*);
BYTE GetUpdateSetting(void);
-int DBUpdate(WPARAM, LPARAM);
int LinklistResizer(HWND,LPARAM,UTILRESIZECONTROL*);
// RTF Save functions
BOOL SaveEditAsStream( HWND );
|