From d296f9f99daf102b9af5d56690e2bd00d61c1267 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 Jul 2018 11:11:26 +0300 Subject: 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. --- plugins/StopSpamMod/src/utilities.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'plugins/StopSpamMod') 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); -- cgit v1.2.3