diff options
-rw-r--r-- | protocols/Quotes/CreateFilePath.cpp | 2 | ||||
-rw-r--r-- | protocols/Quotes/CurrencyConverter.cpp | 2 | ||||
-rw-r--r-- | protocols/Quotes/Forex.cpp | 10 | ||||
-rw-r--r-- | protocols/Quotes/Forex.vcxproj | 1 | ||||
-rw-r--r-- | protocols/Quotes/Forex.vcxproj.filters | 3 | ||||
-rw-r--r-- | protocols/Quotes/IconLib.cpp | 4 | ||||
-rw-r--r-- | protocols/Quotes/ModuleInfo.cpp | 15 | ||||
-rw-r--r-- | protocols/Quotes/ModuleInfo.h | 3 | ||||
-rw-r--r-- | protocols/Quotes/QuoteInfoDlg.cpp | 4 | ||||
-rw-r--r-- | protocols/Quotes/SettingsDlg.cpp | 10 | ||||
-rw-r--r-- | protocols/Quotes/WinCtrlHelper.cpp | 2 | ||||
-rw-r--r-- | protocols/Quotes/stdafx.h | 1 |
12 files changed, 21 insertions, 36 deletions
diff --git a/protocols/Quotes/CreateFilePath.cpp b/protocols/Quotes/CreateFilePath.cpp index f1a3e4f331..23c0c345b0 100644 --- a/protocols/Quotes/CreateFilePath.cpp +++ b/protocols/Quotes/CreateFilePath.cpp @@ -29,7 +29,7 @@ namespace tstring CreateFilePath(const tstring& rsName)
{
TCHAR szPath[_MAX_PATH];
- ::GetModuleFileName(CModuleInfo::GetModuleHandle(),szPath,_MAX_PATH);
+ ::GetModuleFileName(g_hInstance,szPath,_MAX_PATH);
TCHAR* p = _tcsrchr(szPath,_T('\\'));
if(p)
diff --git a/protocols/Quotes/CurrencyConverter.cpp b/protocols/Quotes/CurrencyConverter.cpp index 0e04d2562e..7124677567 100644 --- a/protocols/Quotes/CurrencyConverter.cpp +++ b/protocols/Quotes/CurrencyConverter.cpp @@ -302,7 +302,7 @@ INT_PTR QuotesMenu_CurrencyConverter(WPARAM wp,LPARAM lp) }
else
{
- CreateDialogParam(CModuleInfo::GetModuleHandle(), MAKEINTRESOURCE(IDD_CURRENCY_CONVERTER), NULL, CurrencyConverterDlgProc, 0);
+ CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_CURRENCY_CONVERTER), NULL, CurrencyConverterDlgProc, 0);
}
return 0;
diff --git a/protocols/Quotes/Forex.cpp b/protocols/Quotes/Forex.cpp index 05d1ecaabb..ab27ba41c3 100644 --- a/protocols/Quotes/Forex.cpp +++ b/protocols/Quotes/Forex.cpp @@ -31,7 +31,7 @@ #include "version.h"
int hLangpack;
-
+HINSTANCE g_hInstance = NULL;
HANDLE g_hEventWorkThreadStop;
int g_nStatus = ID_STATUS_OFFLINE;
HGENMENU g_hMenuEditSettings = NULL;
@@ -352,7 +352,7 @@ namespace OPTIONSDIALOGPAGE odp = { 0 };
odp.cbSize = sizeof(odp);
odp.position = 910000000;
- odp.hInstance = CModuleInfo::GetModuleHandle();
+ odp.hInstance = g_hInstance;
odp.ptszTitle = _T(QUOTES_PROTOCOL_NAME);
odp.ptszGroup = LPGENT("Network");
odp.hIcon = Quotes_LoadIconEx(ICON_STR_MAIN);
@@ -392,6 +392,12 @@ namespace }
+BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ g_hInstance = hinstDLL;
+ return TRUE;
+}
+
extern "C"
{
__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
diff --git a/protocols/Quotes/Forex.vcxproj b/protocols/Quotes/Forex.vcxproj index 8acf7ba187..6a06b23120 100644 --- a/protocols/Quotes/Forex.vcxproj +++ b/protocols/Quotes/Forex.vcxproj @@ -175,7 +175,6 @@ <ClCompile Include="CreateFilePath.cpp" />
<ClCompile Include="CurrencyConverter.cpp" />
<ClCompile Include="DBUtils.cpp" />
- <ClCompile Include="dllmain.cpp" />
<ClCompile Include="ExtraImages.cpp" />
<ClCompile Include="Forex.cpp" />
<ClCompile Include="HTMLParserMS.cpp" />
diff --git a/protocols/Quotes/Forex.vcxproj.filters b/protocols/Quotes/Forex.vcxproj.filters index 127582eda6..e84b811df3 100644 --- a/protocols/Quotes/Forex.vcxproj.filters +++ b/protocols/Quotes/Forex.vcxproj.filters @@ -33,9 +33,6 @@ <ClCompile Include="DBUtils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="dllmain.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="ExtraImages.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/protocols/Quotes/IconLib.cpp b/protocols/Quotes/IconLib.cpp index 6957a35d0b..b131aa7009 100644 --- a/protocols/Quotes/IconLib.cpp +++ b/protocols/Quotes/IconLib.cpp @@ -42,11 +42,11 @@ namespace void Quotes_IconsInit()
{
- USES_CONVERSION;
+ USES_CONVERSION;
SKINICONDESC sid = {0};
TCHAR szFile[MAX_PATH];
- ::GetModuleFileName(CModuleInfo::GetModuleHandle(), szFile, MAX_PATH);
+ ::GetModuleFileName(g_hInstance, szFile, MAX_PATH);
sid.cbSize = sizeof(SKINICONDESC);
sid.ptszDefaultFile = szFile;
diff --git a/protocols/Quotes/ModuleInfo.cpp b/protocols/Quotes/ModuleInfo.cpp index 69a835409e..4caec96368 100644 --- a/protocols/Quotes/ModuleInfo.cpp +++ b/protocols/Quotes/ModuleInfo.cpp @@ -9,7 +9,6 @@ namespace
{
- HINSTANCE g_hInstance = NULL;
CModuleInfo::TXMLEnginePtr g_pXMLEngine;
CModuleInfo::THTMLEnginePtr g_pHTMLEngine;
CLightMutex g_lmParsers;
@@ -58,20 +57,6 @@ void CModuleInfo::OnMirandaShutdown() }
}
-void CModuleInfo::SetModuleHandle(HINSTANCE hInstance)
-{
- assert(NULL == g_hInstance);
- assert(NULL != hInstance);
-
- g_hInstance = hInstance;
-}
-
-HINSTANCE CModuleInfo::GetModuleHandle()
-{
- assert(NULL != g_hInstance);
- return g_hInstance;
-}
-
CModuleInfo::TQuotesProvidersPtr CModuleInfo::GetQuoteProvidersPtr()
{
static TQuotesProvidersPtr pProviders(new CQuotesProviders);
diff --git a/protocols/Quotes/ModuleInfo.h b/protocols/Quotes/ModuleInfo.h index 5dcf7e5de6..2882dfae6d 100644 --- a/protocols/Quotes/ModuleInfo.h +++ b/protocols/Quotes/ModuleInfo.h @@ -24,9 +24,6 @@ public: HANDLE GetWindowList(const std::string& rsKey,bool bAllocateIfNonExist = true);
bool GetExtendedStatusFlag()const;
- static void SetModuleHandle(HINSTANCE hInstance);
- static HINSTANCE GetModuleHandle();
-
static bool Verify();
static TQuotesProvidersPtr GetQuoteProvidersPtr();
diff --git a/protocols/Quotes/QuoteInfoDlg.cpp b/protocols/Quotes/QuoteInfoDlg.cpp index 9e33a66a80..61b6fb5f11 100644 --- a/protocols/Quotes/QuoteInfoDlg.cpp +++ b/protocols/Quotes/QuoteInfoDlg.cpp @@ -152,7 +152,7 @@ int QuotesEventFunc_OnUserInfoInit(WPARAM wp,LPARAM lp) OPTIONSDIALOGPAGE odp = {0};
odp.cbSize = sizeof( odp );
- odp.hInstance = CModuleInfo::GetModuleHandle();
+ odp.hInstance = g_hInstance;
odp.hIcon = Quotes_LoadIconEx(ICON_STR_MAIN);
odp.pfnDlgProc = QuoteInfoDlgProc;
@@ -289,7 +289,7 @@ int Quotes_OnContactDoubleClick(WPARAM wp,LPARAM/* lp*/) }
else if(true == IsMyContact(hContact))
{
- CreateDialogParam(CModuleInfo::GetModuleHandle(),MAKEINTRESOURCE(IDD_DIALOG_QUOTE_INFO_1),NULL,QuoteInfoDlgProc1,reinterpret_cast<LPARAM>(hContact));
+ CreateDialogParam(g_hInstance,MAKEINTRESOURCE(IDD_DIALOG_QUOTE_INFO_1),NULL,QuoteInfoDlgProc1,reinterpret_cast<LPARAM>(hContact));
}
return 1;
diff --git a/protocols/Quotes/SettingsDlg.cpp b/protocols/Quotes/SettingsDlg.cpp index 863f75fc5b..0011d2e917 100644 --- a/protocols/Quotes/SettingsDlg.cpp +++ b/protocols/Quotes/SettingsDlg.cpp @@ -126,7 +126,7 @@ namespace ofn.nMaxFile = (DWORD)aFileBuffer.size();
ofn.lpstrFilter = pszFilter;
ofn.nFilterIndex = 1;
- ofn.hInstance = CModuleInfo::GetModuleHandle();
+ ofn.hInstance = g_hInstance;
ofn.lpstrDefExt = _T("log");
// ofn.lpstrFileTitle = NULL;
// ofn.nMaxFileTitle = 0;
@@ -407,7 +407,7 @@ namespace pParam->m_pPopupSettings->InitForContact(pParam->m_hContact);
}
- DialogBoxParam(CModuleInfo::GetModuleHandle(),
+ DialogBoxParam(g_hInstance,
MAKEINTRESOURCE(IDD_DIALOG_POPUP),
hWnd,
EditPopupSettingsDlgProc,reinterpret_cast<LPARAM>(pParam->m_pPopupSettings));
@@ -543,7 +543,7 @@ void ShowSettingsDlg(HANDLE hContact) }
else
{
- CreateDialogParam(CModuleInfo::GetModuleHandle(),MAKEINTRESOURCE(IDD_CONTACT_SETTINGS),NULL,EditSettingsPerContactDlgProc,reinterpret_cast<LPARAM>(hContact));
+ CreateDialogParam(g_hInstance,MAKEINTRESOURCE(IDD_CONTACT_SETTINGS),NULL,EditSettingsPerContactDlgProc,reinterpret_cast<LPARAM>(hContact));
}
}
@@ -714,7 +714,7 @@ namespace case IDC_BUTTON_POPUP_SETTINGS:
{
const CAdvProviderSettings* pAdvSettings = reinterpret_cast<CAdvProviderSettings*>(GetWindowLongPtr(hWnd,GWLP_USERDATA));
- DialogBoxParam(CModuleInfo::GetModuleHandle(),
+ DialogBoxParam(g_hInstance,
MAKEINTRESOURCE(IDD_DIALOG_POPUP),
hWnd,
EditPopupSettingsDlgProc,reinterpret_cast<LPARAM>(pAdvSettings->GetPopupSettingsPtr()));
@@ -1051,7 +1051,7 @@ bool ShowSettingsDlg(HWND hWndParent,CAdvProviderSettings* pAdvSettings) {
assert(pAdvSettings);
- return (IDOK == DialogBoxParam(CModuleInfo::GetModuleHandle(),
+ return (IDOK == DialogBoxParam(g_hInstance,
MAKEINTRESOURCE(IDD_PROVIDER_ADV_SETTINGS),
hWndParent,
EditSettingsPerProviderDlgProc,
diff --git a/protocols/Quotes/WinCtrlHelper.cpp b/protocols/Quotes/WinCtrlHelper.cpp index dba445958e..619fe3d41b 100644 --- a/protocols/Quotes/WinCtrlHelper.cpp +++ b/protocols/Quotes/WinCtrlHelper.cpp @@ -41,7 +41,7 @@ namespace void show_variable_list(HWND hwndParent,const IQuotesProvider* pProvider)
{
- ::DialogBoxParam(CModuleInfo::GetModuleHandle(),
+ ::DialogBoxParam(g_hInstance,
MAKEINTRESOURCE(IDD_DIALOG_VARIABLE_LIST),
hwndParent,
VariableListDlgProc,
diff --git a/protocols/Quotes/stdafx.h b/protocols/Quotes/stdafx.h index 64db4e54f9..5e72bc0e0b 100644 --- a/protocols/Quotes/stdafx.h +++ b/protocols/Quotes/stdafx.h @@ -145,6 +145,7 @@ template<typename T> struct safe_string : public detail::safe_string_impl<T,deta safe_string(PTR p) : detail::safe_string_impl<T,detail::OwnerFree<T>>(p){}
};
+extern HINSTANCE g_hInstance;
// #ifdef MIRANDA_VER
// #undef MIRANDA_VER
|