about ComboBox problem

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2006
Posts: 14
Reputation: rxgmoral is an unknown quantity at this point 
Solved Threads: 0
rxgmoral rxgmoral is offline Offline
Newbie Poster

about ComboBox problem

 
1
  #1
Sep 27th, 2006
about ComboBox problem
<<<<<<<Dialog.h>>>>>>>>
.........
public:
CComboBox Cbx;
struct Data
{
LPCTSTR lpszName;
LPCTSTR lpszValue;
int ID;
};
<<<<<<<Dialog.Cpp>>>>>>>
Data d;
d.lpszName=_T("Name");
d.lpszValue=_T("Value");
d.ID=1;
Cbx.InsertString(0,d.lpszName);
Cbx.SetItemDataPtr(0,(void *)d);
how to struct data append to ComboBox Control,thank
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,578
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1486
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: about ComboBox problem

 
0
  #2
Sep 27th, 2006
Use CComboBox's methods GetItemDataPtr() and SetItemDataPtr() to attach the structure to an item in the combo box.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC