Skip to main content
GameDev.net gamedev.net
🔒 Locked

Retrieving string from combobox and adding it to listbox

Started by noatom May 18, 2013 at 7:25 AM 0 replies 1.1k views
Original Post
noatom
noatom

index = SendDlgItemMessage(hDlg,IDC_COMBO1,CB_GETCURSEL,NULL,NULL);
TCHAR buffer[30];
SendDlgItemMessage(hDlg,IDC_COMBO1,CB_GETCURSEL,index,(LPARAM)buffer);
SendDlgItemMessage(hDlg, IDC_LIST1, LB_ADDSTRING, 0, (LPARAM)buffer);

When it's executed,something is added to the listbox(weird symbols).What could be the problem?The combobox has strings in it.

noatom
noatom

Solved,had to modify it to this:

SendDlgItemMessage(hDlg,IDC_COMBO1,CB_GETCURSEL,index,(LPARAM)buffer);

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.