944,117 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3874
  • C++ RSS
Jan 11th, 2007
0

Help with Getting text from combobox

Expand Post »
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:

C++ Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
elodie is offline Offline
5 posts
since Jan 2007
Jan 11th, 2007
0

Re: Help with Getting text from combobox

Shouldn't you be using strcmp instead of == for comparing strings? Or am I just as baffled as you? :eek:
Reputation Points: 25
Solved Threads: 3
Junior Poster in Training
TylerSBreton is offline Offline
89 posts
since Oct 2006
Jan 11th, 2007
0

Re: Help with Getting text from combobox

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,961 posts
since Aug 2005
Jan 12th, 2007
0

Re: Help with Getting text from combobox

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!!!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
elodie is offline Offline
5 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: help.......... voting system
Next Thread in C++ Forum Timeline: diff C++ Turbo C++





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC