Jump to content

  • Log In with Google      Sign In   
  • Create Account

Retrieving string from combobox and adding it to listbox


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 noatom   Members   -  Reputation: 785

Like
0Likes
Like

Posted 18 May 2013 - 01:25 AM

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.



Sponsor:

#2 noatom   Members   -  Reputation: 785

Like
0Likes
Like

Posted 18 May 2013 - 02:08 AM

Solved,had to modify it to this:

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






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS