summaryrefslogtreecommitdiff
path: root/plugins/IEView
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-01-20 19:48:02 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-01-20 19:48:02 +0000
commite0a53609f587b1fd1b1daff2ae96feb8f39b62e1 (patch)
tree43ca204c287c8e49ed0a4fd5afd008467d818e4a /plugins/IEView
parent1e1240560a1d7761564deb698fe69516492d40b0 (diff)
IEView: code cleanup, vs2010 compilation fix(?)
git-svn-id: http://svn.miranda-ng.org/main/trunk@16131 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView')
-rw-r--r--plugins/IEView/src/IEView.cpp6
-rw-r--r--plugins/IEView/src/IEView.h5
-rw-r--r--plugins/IEView/src/external_funcs.cpp69
-rw-r--r--plugins/IEView/src/external_funcs.h6
4 files changed, 46 insertions, 40 deletions
diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp
index 464d787c4b..3b92ddf519 100644
--- a/plugins/IEView/src/IEView.cpp
+++ b/plugins/IEView/src/IEView.cpp
@@ -421,13 +421,13 @@ STDMETHODIMP IEView::GetTypeInfo(UINT, LCID, LPTYPEINFO*)
{
return S_OK;
}
-STDMETHODIMP IEView::GetIDsOfNames(REFIID riid, OLECHAR **rgszNames, size_t cNames, LCID lcid, DISPID *rgDispId)
+STDMETHODIMP IEView::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
HRESULT retval = S_OK;
for (size_t i = 0; i < cNames; i++)
{
if (!wcscmp(L"db_get", rgszNames[i]))
- rgDispId[i] = DISPID_JS_DB_GET;
+ rgDispId[i] = DISPID_EXTERNAL_DB_GET;
else
{
rgDispId[i] = NULL;
@@ -449,7 +449,7 @@ STDMETHODIMP IEView::Invoke(DISPID dispIdMember,
switch (dispIdMember)
{
- case DISPID_JS_DB_GET:
+ case DISPID_EXTERNAL_DB_GET:
return External::db_get(pDispParams, pVarResult);
}
diff --git a/plugins/IEView/src/IEView.h b/plugins/IEView/src/IEView.h
index d1679b244b..bb464d45e0 100644
--- a/plugins/IEView/src/IEView.h
+++ b/plugins/IEView/src/IEView.h
@@ -374,11 +374,6 @@ extern "C" {
#endif
-enum JS_FUNCTIONS
-{
- DISPID_JS_DB_GET = 652
-};
-
class IEViewSink :public DWebBrowserEvents2 {
private:
int m_cRef;
diff --git a/plugins/IEView/src/external_funcs.cpp b/plugins/IEView/src/external_funcs.cpp
index 26f07d490e..34c2ff5dad 100644
--- a/plugins/IEView/src/external_funcs.cpp
+++ b/plugins/IEView/src/external_funcs.cpp
@@ -4,42 +4,47 @@ namespace External
{
HRESULT db_get(DISPPARAMS *pDispParams, VARIANT *pVarResult)
{
- if (pDispParams->cArgs == 3 && pDispParams && pVarResult)
- {
- MCONTACT hContact = pDispParams->rgvarg[2].vt == VT_INT ? pDispParams->rgvarg[2].intVal : NULL;
- BSTR szModule = pDispParams->rgvarg[1].vt == VT_BSTR ? pDispParams->rgvarg[1].bstrVal : NULL;
- BSTR szSetting = pDispParams->rgvarg[0].vt == VT_BSTR ? pDispParams->rgvarg[0].bstrVal : NULL;
-
- DBVARIANT dbv = { 0 };
+ if (pDispParams->cArgs < 3)
+ return TYPE_E_OUTOFBOUNDS;
- db_get(hContact, _T2A((TCHAR*)szModule), _T2A((TCHAR*)szSetting), &dbv);
+ if (!pDispParams || !pVarResult)
+ return S_OK;
- switch (dbv.type)
- {
- case DBVT_BYTE:
- pVarResult->bVal = dbv.bVal;
- pVarResult->vt = VT_BOOL;
- break;
- case DBVT_WCHAR:
- pVarResult->vt = VT_BSTR;
- pVarResult->bstrVal = ::SysAllocString(dbv.pwszVal);
- break;
- case DBVT_UTF8:
- pVarResult->vt = VT_BSTR;
- pVarResult->bstrVal = ::SysAllocString(ptrW(mir_utf8decodeW(dbv.pszVal)));
- break;
- case DBVT_ASCIIZ:
- pVarResult->vt = VT_BSTR;
- pVarResult->bstrVal = ::SysAllocString(_A2T(dbv.pszVal));
- break;
- case DBVT_DWORD:
- pVarResult->vt = VT_INT;
- pVarResult->intVal = dbv.dVal;
- }
+ MCONTACT hContact = pDispParams->rgvarg[2].vt == VT_INT ? pDispParams->rgvarg[2].intVal : NULL;
+ BSTR szModule = pDispParams->rgvarg[1].vt == VT_BSTR ? pDispParams->rgvarg[1].bstrVal : NULL;
+ BSTR szSetting = pDispParams->rgvarg[0].vt == VT_BSTR ? pDispParams->rgvarg[0].bstrVal : NULL;
+ DBVARIANT dbv = { 0 };
+ db_get(hContact, _T2A((TCHAR*)szModule), _T2A((TCHAR*)szSetting), &dbv);
- return S_OK;
+ switch (dbv.type)
+ {
+ case DBVT_BYTE:
+ pVarResult->bVal = dbv.bVal;
+ pVarResult->vt = VT_BOOL;
+ break;
+ case DBVT_WCHAR:
+ pVarResult->vt = VT_BSTR;
+ pVarResult->bstrVal = ::SysAllocString(dbv.pwszVal);
+ break;
+ case DBVT_UTF8:
+ pVarResult->vt = VT_BSTR;
+ pVarResult->bstrVal = ::SysAllocString(ptrW(mir_utf8decodeW(dbv.pszVal)));
+ break;
+ case DBVT_ASCIIZ:
+ pVarResult->vt = VT_BSTR;
+ pVarResult->bstrVal = ::SysAllocString(_A2T(dbv.pszVal));
+ break;
+ case DBVT_DWORD:
+ pVarResult->vt = VT_INT;
+ pVarResult->intVal = dbv.dVal;
}
- return E_INVALIDARG;
+ return S_OK;
}
+
+ HRESULT ShellExec(DISPPARAMS *pDispParams, VARIANT *pVarResult)
+ {
+ return S_OK;
+ }
+
} \ No newline at end of file
diff --git a/plugins/IEView/src/external_funcs.h b/plugins/IEView/src/external_funcs.h
index 173274a0ce..7a693198a7 100644
--- a/plugins/IEView/src/external_funcs.h
+++ b/plugins/IEView/src/external_funcs.h
@@ -1,4 +1,10 @@
+enum EXTERNAL_FUNCTIONS
+{
+ DISPID_EXTERNAL_DB_GET = 652
+};
+
namespace External
{
HRESULT db_get(DISPPARAMS *pDispParams, VARIANT *pVarResult);
+ HRESULT ShellExec(DISPPARAMS *pDispParams, VARIANT *pVarResult);
} \ No newline at end of file