1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
// Get value from ListBox.
char selectedValue[256];
memset(selectedValue, NULL, 256);
SendMessage(GetDlgItem(hWnd, IDC_LB_CURRENTSCRIPT), LB_GETTEXT, selectedIndex, (LPARAM)selectedValue);
// Convert to string.
string val(selectedValue);
// (Some testing to see what happens if I convert the string back to a char array.)
char newVal[256];
memset(newVal, NULL, 256);
strcpy(newVal, val.c_str());
// Original text: Right
MessageBox(hWnd, (LPCWSTR)val.cstr(), L"", 0);
// ^ Result: R쳌쳌쳌쳌쳌쳌쳌
MessageBox(hWnd, (LPCWSTR)newVal, L"", 0);
// ^ Result: R
parser.extract(selectedValue);
SendMessage(GetDlgItem(hwnd, IDC_E_VALUE), WM_SETTEXT, selectedIndex, (LPARAM)parser.getAction().c_str());
// ^ Result: R쳌쳌쳌쳌쳌쳌쳌
break;
|