diff options
author | George Hazan <george.hazan@gmail.com> | 2013-09-01 19:08:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-09-01 19:08:53 +0000 |
commit | 84567ddcd9ff730cdcb7815b6ba0007d693cd52b (patch) | |
tree | 3ee57fc2ac744c030e86df86fcf56aaa8845938b /protocols/MRA/src/Mra_options.cpp | |
parent | 856648d8c6f14c7d57aba610588f52c79ec18987 (diff) |
VERY EXPERIMENTAL VERSION OF MEA, DON'T USE IN PRODUCTION
git-svn-id: http://svn.miranda-ng.org/main/trunk@5897 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/src/Mra_options.cpp')
-rw-r--r-- | protocols/MRA/src/Mra_options.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/protocols/MRA/src/Mra_options.cpp b/protocols/MRA/src/Mra_options.cpp index 82b0885e47..e4ae3f5eab 100644 --- a/protocols/MRA/src/Mra_options.cpp +++ b/protocols/MRA/src/Mra_options.cpp @@ -3,7 +3,7 @@ INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
CMraProto *ppro = (CMraProto*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
- WCHAR szBuff[MAX_EMAIL_LEN];
+ CMStringW szBuff;
switch (msg) {
case WM_INITDIALOG:
@@ -11,8 +11,8 @@ INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARA SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
ppro = (CMraProto*)lParam;
- if ( ppro->mraGetStaticStringW(NULL, "e-mail", szBuff, SIZEOF(szBuff), NULL))
- SET_DLG_ITEM_TEXTW(hWndDlg, IDC_LOGIN, szBuff);
+ if ( ppro->mraGetStringW(NULL, "e-mail", szBuff))
+ SET_DLG_ITEM_TEXTW(hWndDlg, IDC_LOGIN, szBuff.c_str());
SET_DLG_ITEM_TEXTW(hWndDlg, IDC_PASSWORD, (LPWSTR)L"");
return TRUE;
@@ -36,11 +36,12 @@ INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARA case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
+ WCHAR szBuff[MAX_EMAIL_LEN];
GET_DLG_ITEM_TEXT(hWndDlg, IDC_LOGIN, szBuff, SIZEOF(szBuff));
- ppro->mraSetStringW(NULL, "e-mail", szBuff);
+ ppro->setWString(NULL, "e-mail", szBuff);
if (GET_DLG_ITEM_TEXTA(hWndDlg, IDC_PASSWORD, (LPSTR)szBuff, SIZEOF(szBuff))) {
- ppro->SetPassDB((LPSTR)szBuff, lstrlenA((LPSTR)szBuff));
+ ppro->SetPassDB((LPSTR)szBuff);
SecureZeroMemory(szBuff, sizeof(szBuff));
}
return TRUE;
@@ -53,7 +54,7 @@ INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARA INT_PTR CALLBACK DlgProcAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
CMraProto *ppro = (CMraProto*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
- WCHAR szBuff[MAX_EMAIL_LEN];
+ CMStringW szBuff;
switch (msg) {
case WM_INITDIALOG:
@@ -61,8 +62,8 @@ INT_PTR CALLBACK DlgProcAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lP SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
ppro = (CMraProto*)lParam;
- if ( ppro->mraGetStaticStringW(NULL, "e-mail", szBuff, SIZEOF(szBuff), NULL))
- SET_DLG_ITEM_TEXTW(hWndDlg, IDC_LOGIN, szBuff);
+ if ( ppro->mraGetStringW(NULL, "e-mail", szBuff))
+ SET_DLG_ITEM_TEXTW(hWndDlg, IDC_LOGIN, szBuff.c_str());
SET_DLG_ITEM_TEXTW(hWndDlg, IDC_PASSWORD, (LPWSTR)L"");
return TRUE;
@@ -87,11 +88,12 @@ INT_PTR CALLBACK DlgProcAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
+ WCHAR szBuff[MAX_EMAIL_LEN];
GET_DLG_ITEM_TEXT(hWndDlg, IDC_LOGIN, szBuff, SIZEOF(szBuff));
ppro->mraSetStringW(NULL, "e-mail", szBuff);
if (GET_DLG_ITEM_TEXTA(hWndDlg, IDC_PASSWORD, (LPSTR)szBuff, SIZEOF(szBuff))) {
- ppro->SetPassDB((LPSTR)szBuff, lstrlenA((LPSTR)szBuff));
+ ppro->SetPassDB((LPSTR)szBuff);
SecureZeroMemory(szBuff, sizeof(szBuff));
}
return TRUE;
@@ -104,7 +106,7 @@ INT_PTR CALLBACK DlgProcAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lP INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
CMraProto *ppro = (CMraProto*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
- WCHAR szBuff[MAX_PATH];
+ CMStringW szBuff;
switch (msg) {
case WM_INITDIALOG:
@@ -112,8 +114,8 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L SetWindowLongPtr(hWndDlg, GWLP_USERDATA, lParam);
ppro = (CMraProto*)lParam;
- if (ppro->mraGetStaticStringW(NULL, "Server", szBuff, SIZEOF(szBuff), NULL))
- SET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szBuff);
+ if (ppro->mraGetStringW(NULL, "Server", szBuff))
+ SET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szBuff.c_str());
else
SET_DLG_ITEM_TEXTA(hWndDlg, IDC_SERVER, MRA_DEFAULT_SERVER);
@@ -191,6 +193,7 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
+ WCHAR szBuff[MAX_PATH];
GET_DLG_ITEM_TEXT(hWndDlg, IDC_SERVER, szBuff, SIZEOF(szBuff));
ppro->mraSetStringW(NULL, "Server", szBuff);
ppro->setWord("ServerPort", (WORD)GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
|