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

Shouldn't you be using strcmp instead of == for comparing strings? Or am I just as baffled as you? :eek:

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?

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.