Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


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: 823

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: 823

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