0

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:

//default video format
  dirac_encoder_presets_t preset = VIDEO_FORMAT_CUSTOM;
 
  //get the video format selected by the user
  VideoFormat = FormatTypeComboBox->Text();
 
  if(VideoFormat == "QCIF")
  {
        preset = VIDEO_FORMAT_QCIF;
  }

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

3
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by elodie
0

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?

0

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!!!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.