Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Retrieving string from combobox and adding it to listbox

4: Adsense

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   

925
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.



#2 noatom   Members   

925
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.