Help with Getting text from combobox

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2007
Posts: 5
Reputation: elodie is an unknown quantity at this point 
Solved Threads: 0
elodie elodie is offline Offline
Newbie Poster

Help with Getting text from combobox

 
0
  #1
Jan 11th, 2007
Hi,

I'm having a problem with retrieving the text from a combobox. When i do the index of where the text is in the combobox is returned as well as the text.

My code is as follows:

  1.  
  2. //default video format
  3. dirac_encoder_presets_t preset = VIDEO_FORMAT_CUSTOM;
  4.  
  5. //get the video format selected by the user
  6. VideoFormat = FormatTypeComboBox->Text();
  7.  
  8. if(VideoFormat == "QCIF")
  9. {
  10. preset = VIDEO_FORMAT_QCIF;
  11. }

The preset value is set to 3/*VIDEO_FORMAT_QCIF*/
where 3 is the index of VIDEO_FORMAT_QCIF.

I'm really baffled by this :rolleyes:

Can anybody help?

Thanks
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 89
Reputation: TylerSBreton is an unknown quantity at this point 
Solved Threads: 3
TylerSBreton's Avatar
TylerSBreton TylerSBreton is offline Offline
Junior Poster in Training

Re: Help with Getting text from combobox

 
0
  #2
Jan 11th, 2007
Shouldn't you be using strcmp instead of == for comparing strings? Or am I just as baffled as you? :eek:
Western New England College '08
Computer Science

Programming Lang's:

C, C#, Java, Lisp, MASM, Visual Basic 6
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,494
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: 1478
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Help with Getting text from combobox

 
0
  #3
Jan 11th, 2007
Originally Posted by TylerSBreton View Post
Shouldn't you be using strcmp instead of == for comparing strings?
depends on how VideoFormat is declared.

>> VideoFormat = FormatTypeComboBox->Text();
Is this MS-Windows combo box? or something else, such as *nix? what compiler and os are you using?
Last edited by Ancient Dragon; Jan 11th, 2007 at 1:38 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 5
Reputation: elodie is an unknown quantity at this point 
Solved Threads: 0
elodie elodie is offline Offline
Newbie Poster

Re: Help with Getting text from combobox

 
0
  #4
Jan 12th, 2007
I'm using Borland C++ builder.

the strcmp doesn't seem to make a difference either and i tried using ItemIndex instead of text to compare with and the result was still the same. the index infront of the preset value.
Really strange!!!!
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



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC