summaryrefslogtreecommitdiff
path: root/plugins/StopSpamMod/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-24 11:11:26 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-24 11:11:26 +0300
commitd296f9f99daf102b9af5d56690e2bd00d61c1267 (patch)
tree39311caaf80abf0b47ecb78cf94dc8157b193575 /plugins/StopSpamMod/src
parentffc521e5d5e9bd66feb65afe0046b3fc7e073356 (diff)
database:
- senseless fiels ptszVal removed from DBVARIANT, pwszVal is used instead; - if you want db_get to return a string, you need to use db_get_s.
Diffstat (limited to 'plugins/StopSpamMod/src')
-rwxr-xr-xplugins/StopSpamMod/src/utilities.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp
index 9402597f71..370def4c18 100755
--- a/plugins/StopSpamMod/src/utilities.cpp
+++ b/plugins/StopSpamMod/src/utilities.cpp
@@ -20,11 +20,10 @@
wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, wstring errorValue)
{
DBVARIANT dbv;
- //if(db_get(hContact, szModule, szSetting, &dbv))
- if (db_get_ws(hContact, szModule, szSetting, &dbv))
+ if (db_get_ws(hContact, szModule, szSetting, &dbv))
return errorValue;
- // if(DBVT_WCHAR == dbv.type )
- errorValue = dbv.ptszVal;
+
+ errorValue = dbv.pwszVal;
db_free(&dbv);
return errorValue;
}
@@ -32,16 +31,15 @@ wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, c
std::string DBGetContactSettingStringPAN_A(MCONTACT hContact, char const * szModule, char const * szSetting, std::string errorValue)
{
DBVARIANT dbv;
- //if(db_get(hContact, szModule, szSetting, &dbv))
if (db_get_s(hContact, szModule, szSetting, &dbv))
return errorValue;
- // if(DBVT_ASCIIZ == dbv.type )
+
errorValue = dbv.pszVal;
db_free(&dbv);
return errorValue;
}
-wstring &GetDlgItemString(HWND hwnd, int id)
+wstring& GetDlgItemString(HWND hwnd, int id)
{
HWND h = GetDlgItem(hwnd, id);
int len = GetWindowTextLength(h);